Doha will host the 2030 Asian Games and rival Riyadh will stage the event in 2034 following a vote at today's Olympic Council of Asia (OCA) General Assembly in Muscat.
The double award comes after OCA President Sheikh Ahmad Al-Fahad Al-Sabah arranged a "win win" situation which saw the city with the most votes awarded the 2030 Games and the runner-up given 2034.
It means back-to-back Games will be held in West Asia with an intriguing race between two fierce political opponents ending with both Qatar and Saudi Arabia having something to show for it.
Qatar's capital won on the day, however, gaining 27 votes compared to Riyadh's 10 with eight abstentions.
The electronic vote was plagued by technical problems and was repeatedly delayed as some countries attended in the room and others joined virtually.
In the end, the 26 countries present at the JW Marriott Hotel in Oman's capital had to vote the old fashioned way, by walking up to a ballot box, with the 19 remaining nations still able to vote electronically.
There was also confusion when a tab labelled "learn ethical hacking" was noticed on the screen during the vote, leading to fears the ballot was being manipulated.
Sheikh Ahmad said an OCA staff member's laptop had "shut down" and had been replaced with one used by an Omani technician, which had the tab about a hacking course visible.
It led to observers from both Doha and Riyadh being present in the control room when the vote took place, with a source telling insidethegames that each bid was left "furious" by the problems.
At one stage members of the media and camera crews were asked to leave the room, with Sheikh Ahmad claiming some delegates had expressed fears about their votes being filmed as they typed on their iPads.
Cameras were later allowed to return for the manual vote.
The double award plan was greeted with a round of applause when Sheikh Ahmad explained it and was voted through by the Assembly unanimously.
On the eve of the vote yesterday, the Kuwaiti said he hoped to find a "solution" for both parties as the OCA always shows "solidarity and unity".
It has drawn parallels with International Olympic Committee President Thomas Bach's move to award the 2024 and 2028 Summer Games simultaneously to Paris and Los Angeles.
"I believe you are making history, and I will be proud to have two Asian Games in West Asia," Sheikh Ahmad told the Assembly.
"Thank you Asia for your solidarity and coordination."
Having two bidders is a departure from usual practice for the OCA, which normally makes known its preferred host before electing it without a vote.
Qatar and Saudi Arabia were bidding against a backdrop of international criticism over their records on human rights, as well as a bitter diplomatic dispute which saw Riyadh initiate a blockade of its neighbour after accusing Doha of sponsoring terrorism and backing its regional nemesis Iran.
The Qatari capital also hosted the Games in 2006 while Riyadh's staging in 2034 will be a first for Saudi Arabia.
Both countries had described their bids as "national priorities" with Saudi Arabia missing out on staging the Games in the year its Vision 2030 document, the Kingdom's ambitious blueprint for the future, expires.
Chinese city Hangzhou will host in 2022, with Aichi-Nagoya in Japan the venue for the 2026 Games.
The next Asian Games which are available to bid for are now in 2038, a distant 18 years away.
"This is a very proud and special moment for the whole of Qatar and the West Asian region," said Doha 2030 chairman and Qatar Olympic Committee President HE Sheikh Joaan bin Hamad Al-Thani.
"Hosting the 2030 Asian Games has been a national priority for our country and so we are humbled and greatly honoured to have been awarded this prestigious event.
"We sincerely thank the OCA and its leadership and Asia's NOCs for putting their trust in Doha.
"We can assure the whole OCA family that we do not take this responsibility for granted, and we will work tirelessly to deliver an Asian Games where 'We All Belong'.
"We are also delighted that our West Asian neighbours, Saudi Arabia, have been given the opportunity to host the 2034 Asian Games and we wish them and the Saudi Arabian Olympic Committee all the best."
Both Qatar and Saudi Arabia have made increasing plays for major sporting events in recent times.
The oil-rich nations are both in the race for football's 2027 Asian Cup while Qatar, the 2022 FIFA World Cup host, has said it could bid for the 2032 Summer Olympic Games.
HRH Prince Abdulaziz bin Turki Alfaisal, the President of both the now-named Riyadh 2034 and the Saudi Arabian Olympic Committee, said his city and country were "overwhelmed with joy" to host the Asian Games four years later than initially hoped.
"We applaud this dual award decision by the OCA and the NOCs of Asia," he said.
"It is the best outcome for the OCA and the two great bid cities who campaigned competitively and in the spirit of great sportsmanship.
"Most of all, today's historic decision is great news for Asian sport and our athletes - who will be able to train and prepare for 2030 and 2034 knowing they are in great hands with two amazing host cities.
"We would like to thank the OCA and NOCs of Asia for handing us this important responsibility.
"We will treasure this opportunity and work hard every day to deliver an Asian Games that the whole of Asia can be proud of.
"We are grateful for the leadership and vision of King Salman and His Royal Highness Crown Prince Mohammed bin Salman, and greatly appreciate the support of the Saudi Arabian Government and all those who worked on our bid.
"We also congratulate Doha and wish them the very best of luck for 2030."