Switzerland's parliament has voted socialist Simonetta Sommaruga into the government in a historic step that gave women a majority of cabinet posts for the first time.

Women only gained the vote at national level in 1971 and the first female minister was elected in 1984.

Prior to the vote, three of the seven ministerial posts in the federal council were occupied by women.

Ms Sommaruga was elected into office with 159 votes out of 245 to replace transport minister Moritz Leuenberger, who will retire on October 31.

"I'm pleased that we will be working together and I accept my election," Ms Sommaruga said to both houses of parliament.

Another ministerial post was also due to be voted on on Wednesday.

- AFP