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 had breast cancer, died on Saturday, the university said. 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,” the Stanford press announcement said.

“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.”

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

Mirzakhani was born in Tehran and studied there and at Harvard. She joined Stanford as a mathematics professor in 2008. Iran’s president, Hassan Rouhani, issued a statement praising Mirzakhani.

“The grievous passing of Maryam Mirzakhani, the eminent Iranian and world-renowned mathematician, is very much heart-rending,” 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 newspaper 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.”

Mirzakhani originally dreamed of becoming a writer but then shifted to mathematics. When she was working, she would doodle on sheets of paper and scribble formulas on the edges of her drawings, leading her daughter to describe the work as painting, the Stanford statement said.

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”.

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

Mirzakhani is survived by her husband, Jan Vondrák, and daughter, Anahita.

