Mr Van Rompuy was widely tipped, but Baroness Ashton was not
EU leaders have chosen the Belgian Prime Minister, Herman van Rompuy, to be the first permanent European Council President.
The other top job created by the Lisbon Treaty - foreign affairs supremo - has gone to the EU Trade Commissioner, Baroness Catherine Ashton from the UK.
Both are seen as consensual politicians with limited foreign policy experience.
Both had unanimous backing from the 27 EU leaders at the summit in Brussels, UK Prime Minister Gordon Brown said.
Earlier, the UK government had said it was no longer pushing for former PM Tony Blair to get the presidency post.
Mr Van Rompuy, 62, had crucial French and German support. He has a reputation as a coalition builder, having taken charge of the linguistically divided Belgian government and steered it out of a crisis.
Herman van Rompuy: Every country should emerge victorious from negotiations
"Every country should emerge victorious from negotiations," he told a news conference after his appointment.
"Even if unity remains our strength, our diversity remains our wealth," he said, stressing the individuality of EU member states.
Baroness Ashton, 53, said she felt "deeply privileged" to get the foreign affairs post.
"I was the first woman British commissioner, the first woman trade commissioner, so I am also proud to be the first woman High Representative," she said.
"I think there was a strong push to have at least one woman in a senior position," she told the BBC later, adding that she hoped Europe would become "an economic superpower".
US President Barack Obama said the appointments would "strengthen the EU and enable it to be an even stronger partner to the United States".
"The United States has no stronger partner than Europe in advancing security and prosperity around the world," the White House said in a statement.
UK shifts stance
Earlier, a UK government spokesman revealed the dramatic twist in the British position.
Jonny Dymond, BBC News, Brussels
Against all expectations this deal was done in a matter of hours, the pre-summit deadlock broken by British Prime Minister Gordon Brown.
His decision to abandon Tony Blair's bid for the new post of President of the European Council meant the field was left clear for the Belgian prime minister, Herman van Rompuy.
It also meant that he could bag for a Briton the second job of the night - one arguably more important and probably higher-profile - that of High Representative, something close to a foreign minister for Europe.
Neither Mr Van Rompuy nor Baroness Ashton are what might be called big-hitters. Their selection indicates a preference for a low-key start to these new jobs.
The UK persuaded the other six leaders in the socialist group to back Baroness Ashton, having dropped Tony Blair.
EU leaders met in Brussels especially to select their first full-time president and the High Representative for Foreign Affairs - new posts created by the Lisbon Treaty, which will come into force on 1 December.
The idea under Lisbon is to give the EU more coherence and continuity in key policy areas. Up until now the presidency has been held by member states in turn, on a six-month rotation.
Going into the meeting the leaders had various candidates to choose from.
There were fears that the negotiations would go on late into the night, but it quickly emerged that a deal had been struck.
Drive for consensus
Mr Brown praised Mr Van Rompuy as "a consensus builder" who had "brought a period of political stability to his country after months of uncertainty".
Turning to Baroness Ashton's appointment, he said "it gives Britain a powerful voice within the Council and the [EU] Commission.
He is camera-shy, a man who some refer to as the "grey mouse"
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.