BIRMINGHAM, England — The lines began building two hours before Britain’s former foreign secretary Boris Johnson walked into the 1,500-seat hall, to be greeted by wild cheers and a noisy ovation. As his speech reached a climax, there were uncontrolled whoops of joy.

Like him or loathe him — and there are many in both camps — it was impossible to ignore Mr. Johnson, whose appearance on Tuesday at the Conservative Party’s annual conference overshadowed an announcement on immigration policy from the person whose job he so obviously craves: Prime Minister Theresa May.

But there also seemed to be an element of desperation beneath Mr. Johnson’s ill-disguised ambition.

“He’s aware that his political tide is seeping away,” said Richard Hayton, an associate professor of politics at the University of Leeds. “If he doesn’t get the leadership in the aftermath of what will happen over Brexit in the next few months, it will pass him by for a new generation.”

Mr. Johnson made a damning, if familiar, attack on Mrs. May’s plan for Britain’s withdrawal from the European Union, known as Brexit — a blueprint that would keep some close economic ties to the bloc to minimize disruption to trade and protect the economy.