A Nepali communist leader, known for her advocacy on behalf of women's rights, was elected president of Nepal on Wednesday.

Bidhya Devi Bhandari — a seasoned politician who's served as a member of parliament and as defense minister — won 327 votes of 541 votes cast in the Nepali parliament, making her the first-ever female president. The post is largely ceremonial and was established in 2008.

Bhandari, 54, is already the deputy leader of the ruling Marxist-Leninist party led by Prime Minister Khadga Prasad Oli. Oli won election earlier this month and presides over a broad coalition government that includes both communist and non-communist parties.

Last month, Nepal adopted a new constitution that required it to select a new president, setting into motion a leadership battle between Bhandari and Kul Bahadur Gurung of the Nepali Congress Party.

Newly elected President Bhandari has long been a leader on women's rights issues in Nepal. She championed several women's rights guarantees in the recently adopted constitution, including a provision that requires either the president or vice-president to be a woman. The new constitution also mandates that women be included in all government committees and that at least one-third of parliamentarians be female.

But she's been criticized by some in Nepal for not going far enough. Remarks she made about gender roles were recently printed in a local newspaper, causing some controversy.

"Whether we agree with it or not, in Eastern culture and tradition, a woman is entirely devoted to a man," she said. "This may be a discriminatory system, but our society has always functioned this way."

Bhandari first rose to national attention after her husband, community party chairman, Madan Bhandari, was killed in a mysterious car accident in 1993. She was a prominent leader in demonstrations against Nepal's former monarch-King Gyanendra, that eventually led to his ouster in 2006.