Sakellaropoulou's candidacy was backed by 261 lawmakers out of 300, including by the members of the ruling New Democracy party.
"Ekaterini Sakellaropoulou has been elected president of the republic," parliament chief Costas Tassoulas said.
She will serve for five years starting on March 13, when the incumbent president, Prokopis Pavlopoulos, will vacate the post following the end of his term.
Sakellaropoulou, who was also the first woman to head the Council of State, is the daughter of a Supreme Court judge and completed postgraduate studies at Paris's Sorbonne University.
In Greece, the president has a largely ceremonial role and limited political power.