 Ivanović received his first cap on 8 June 2005 in Toronto, Ontario, Canada, when Serbia and Montenegro played a friendly against Italy, coming on as a 77th-minute substitute for his club teammate Marko Baša in an eventual 1–1 draw.He was not included at the 2006 FIFA World Cup and did not play an international again until after the country's dissolution that year.Ivanović scored his first international goal on 12 September 2007 in a UEFA Euro 2008 qualifying match against Portugal in Lisbon; following a Dejan Stanković in-swinging freekick, he scored with two minutes remaining to seal a 1–1 draw.