Saudi Arabia denied permission for a plane carrying Sudanese President Omar al-Bashir to cross its airspace on Sunday for the swearing-in of the new Iranian president, Khartoum said.
The aircraft had to turn back.
"The Saudi authorities refused to give the plane carrying President Bashir permission to cross their airspace," Emad Sayed Ahmed, the presidential press secretary, told AFP.
Saudi Arabia, a Sunni Muslim kingdom, has repeatedly voiced fears about the controversial nuclear programme of Shiite-dominated Iran, whose warships twice docked in Sudan late last year.
Ahmed said Bashir was not flying in his normal presidential aircraft but was using a plane rented from a Saudi company.
The Sudanese leader was travelling to attend President Hassan Rowhani's swearing-in before the Iranian parliament.
Ten leaders from around the region, including the prime minister of close Iranian ally Syria, had been due to attend Sunday's parliamentary session, Iranian reports said.
Ahmed said that when Bashir's plane entered Saudi airspace the pilot informed authorities that it had approval "and that it was carrying President Bashir.
"But they said the plane didn't have permission," forcing it to return to Khartoum, he said.
The official SUNA news agency had sent a brief SMS alert at 0706 GMT announcing that Bashir "leaves for Tehran on an official two-day visit to Iran".
The Hague-based International Criminal Court in 2009 and 2010 issued two warrants against Bashir for war crimes, crimes against humanity and genocide over the conflict in Sudan's Darfur region.
Khartoum's links with Iran came under scrutiny after Bashir's regime accused Israel of an October 23 strike against the Yarmouk military factory in the capital, which led to speculation that Iranian weapons were stored or manufactured there.
Israel refused all comment on Sudan's accusation about the factory blast.
But a top Israeli defence official, Amos Gilad, said Sudan "serves as a route for the transfer, via Egyptian territory, of Iranian weapons to Hamas and Islamic Jihad terrorists".
Later in October two Iranian navy vessels called at Port Sudan, followed by two more in December, in what Khartoum described as a "normal" port call.