Foreign Minister Micheline Calmy-Rey has been elected Swiss president for 2007, only the second woman to hold the office in the country's history.
The joint session of the two parliamentary chambers on Wednesday also named Interior Minister Pascal Couchepin vice-president.
Calmy-Rey will keep her foreign ministry portfolio when she takes over the ceremonial one-year post from Moritz Leuenberger, on January 1.
The 61-year-old Social Democrat received 147 votes (out of 192 valid votes), the poorest result in presidential elections for nearly 70 years.
However, she enjoys a high level of support among the public and regularly tops popularity polls for Swiss politicians.
The rightwing Swiss People's Party continued to take shots at Calmy-Rey for her foreign policy and stance on neutrality, which they consider overly active.
Nevertheless they officially supported her election, although the low turn-out suggests that many of them did not in fact vote for her.
For his part Couchepin, from the centre-right Radical Party, took 166 votes in the election for vice-president and will assume the top job in 2008.
Speaking after her election, Calmy-Rey said she was very happy and aware of the responsibility of the post.
"I will try to represent Switzerland as best as I can at home and abroad."
Calmy-Rey said her aim was also to create the necessary conditions for a well-functioning seven-member cabinet.
She added she wanted to be in touch with the population despite the increasing workload during the presidential year.
Calmy-Rey entered local politics as a member of the centre-left Social Democratic Party of Geneva in 1979, and in 2002 she was elected to the cabinet by the federal parliament.
She took over the foreign ministry and has pursued an active policy marked by raising the profile of Swiss diplomacy and promoting international law, human rights and peace.
She has pushed several diplomatic initiatives: the Geneva Accord, an unofficial peace proposal aimed at solving the Israeli-Palestinian conflict; the United Nations Human Rights Council; the Red Crystal symbol of the International Committee of the Red Cross, and her efforts to secure independence for Kosovo.
swissinfo with agencies
Micheline Calmy-Rey was born in Chermignon in Canton Valais on July 8, 1945.
She is married with two children and has a degree in political science from the Graduate Institute of International Studies in Geneva.
Ruth Dreifuss was the first female president of Switzerland - where women have had the right to vote in national elections only since 1971 - serving a one-year term in 1999.
1981-1997: Member of the Geneva cantonal parliament, chair of the finance commission, later speaker of the parliament.
1997: elected to the Geneva cantonal government.
2001: president of the Geneva cantonal government.
December 2002: elected to the cabinet, heading the foreign ministry. She is the fourth woman to be elected to the cabinet.
December 2006: elected Swiss president for 2007.