After a protracted election process in Italy on Friday, Cookson, the president of British Cycling since 1996, took the presidency with 24 votes to McQuaid's 18 from the 42 voting delegates.
It capped a long and frustrating day in Florence's Palazio Vecchio where McQuaid, in power since 2005, had initially failed to gain nomination but forced his way through by relying on loopholes in the UCI constitution.
As the election descended into near farce, with many voting delegates taking the floor to criticise a process that threatened to drag on even further, Cookson grew frustrated and called McQuaid's bluff.
"Alright, we've had enough of this," said the Englishman.
"I'm going to propose that we pass straight to the election."
Less than 30 minutes later the result that ended McQuaid's bid for a third mandate was delivered.
Loud applause erupted and a triumphant Cookson said: "It is a huge honour to have been elected president of the UCI by my peers and I would like to thank them for the trust they have placed in me today.
"The campaign to get to this point has been intense but I am under no illusion that the real work starts now.
"So I call on the global cycling community to unite and come together to help ensure that our great sport realises its enormous potential.
"This is the vision that will drive and focus my activities over the next four years.
"I have said throughout my campaign that we must embrace a new style of governance and a collegiate way of working so that a new era of growth and commercial success for the UCI and our sport can begin.
"Ultimately that's how we are going to grow our sport worldwide and get fans into cycling."
Turning to McQuaid, who said he would walk away from the sport if defeated, Cookson added: "I would like to thank Pat very sincerely for the contribution he has made to world cycling
"I wish him well in whatever he goes on to do."
In keeping with the rhythm of the day's events, McQuaid continued the congress as if nothing had happened.
"Thank you Brian, and congratulations to you," said the Irishman.
"We now move on to point 11."
For McQuaid, who helped boost cycling's anti-doping fight but ultimately took the flak for the UCI's poor handling of the Armstrong affair, it was a unceremonious end to his eight-year reign.
However, despite both candidates lobbying hard and dirty in recent months, McQuaid arguably had the biggest handicap.
He did not meet the conditions set down in article 51.1 of the UCI constitution, namely being nominated as a presidential candidate by his home federation.
Having also seen an initial nomination by Switzerland, where the UCI has its headquarters in Aigle in the canton of Vaud, later withdrawn, McQuaid sought to push through a new amendment to the article.
Opposition was raised by the British delegate supporting Cookson and was given support by Australia as several delegates complained about the rules being changed "mid-race".
A secret ballot, during which all 42 delegates were asked whether or not to vote on making the amendment to article 51.1 on Friday, was held and after it returned a 21-21 draw it was effectively defeated.
McQuaid, however, had further cards to play.
He presented two Swiss lawyers who said the article was open to interpretation, allowing him to be nominated by the Thai and Moroccan federations, of which he is an honorary member.
They also claimed the Swiss federation's withdrawal of his nomination had no legal standing in the country.
The election threatened to drag on and mention was made of sport's top court, the Court of Arbitration for Sport (CAS).
But as delegates lined up to criticise the process, Cookson played his best card and came up trumps.