Maryam Mirzakhani, a Stanford University professor who was the first and only woman to win the prestigious Fields Medal in mathematics, has died. She was 40.

Mirzakhani, who battled breast cancer, died on Saturday, the university announced. It did not indicate where she died.

In 2014, Mirzakhani was one of four winners of the Fields Medal, which is presented every four years and is considered the mathematics equivalent of the Nobel Prize. She was named for her work on complex geometry and dynamic systems.

"Mirzakhani specialized in theoretical mathematics that read like a foreign language by those outside of mathematics: moduli spaces, Teichmüller theory, hyperbolic geometry, Ergodic theory and symplectic geometry," according to the Stanford press announcement. "Mastering these approaches allowed Mirzakhani to pursue her fascination for describing the geometric and dynamic complexities of curved surfaces — spheres, doughnut shapes and even amoebas — in as great detail as possible."

The work had implications in fields ranging from cryptography to "the theoretical physics of how the universe came to exist," the university said.

Iran mourns

Born in Tehran, Iran, she attended an all-girls high school and gained recognition as a teenager in the 1994 and 1995

competitions of the International Mathematical Olympiad.

She earned her doctorate in mathematics at Harvard University in 2008 and joined Stanford as a professor shortly thereafter.

Iran's President Hassan Rouhani issued a statement Saturday praising Mirzakhani. "The grievous passing of Maryam Mirzakhani, the eminent Iranian and world-renowned mathematician, is very much heartrending," Rouhani said in a message that was reported by the Tehran Times.

Iran's foreign minister, Mohammad Javad Zarif, said her death pained all Iranians, the Tehran Times reported.

"The news of young Iranian genius and math professor Maryam Mirzakhani's passing has brought a deep pang of sorrow to me and all Iranians who are proud of their eminent and distinguished scientists," Zarif posted in Farsi on his Instagram account. "I do offer my heartfelt condolences upon the passing of this lady scientist to all Iranians worldwide, her grieving family and the scientific community."

Brilliant theorist

Mirzakhani originally dreamed of becoming a writer but then shifted to mathematics.

When she was working, Mirzakhani would doodle on sheets of paper and scribble formulas on the edges of her drawings, leading her daughter to describe the work as painting, according to the Stanford statement.

Mirzakhani once described her work as "like being lost in a jungle and trying to use all the knowledge that you can gather to come up with some new tricks, and with some luck you might find a way out."

In recent years, she worked with Alex Eskin at the University of Chicago to investigate the trajectory of a billiard ball as it bounces around a polygonal table. The complexities in the ball's movement have long bedevilled physicists.

Stanford President Marc Tessier-Lavigne called Mirzakhani a brilliant theorist who made enduring contributions and inspired thousands of women to pursue math and science.

Mirzakhani is survived by her husband, Jan Vondrak, and daughter, Anahita.