STANFORD, Calif. -- Maryam Mirzakhani, a professor at Stanford University 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.

Get Breaking News Delivered to Your Inbox

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

It added, "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.

Mirzakhani was born in Tehran, Iran, and studied there and at Harvard University. She joined Stanford as a mathematics professor in 2008.

Professor Maryam Mirzakhani was the recipient of the 2014 Fields Medal, the top honor in mathematics. Maryam Mirzakhani/Corbis via Getty

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, the Tehran Times reports.

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

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

Maryam Mirzakhani is awarded with the 2014 Fields medal at the International Congress of Mathematicians in Seoul, South Korea on August 13, 2014. Lee Young-Ho/Sipa USA

In a 2008 interview with the Clay Mathematics Institute, Mirzakhani was asked to give advice to younger students.

"I am really not in a position to give advice; I usually use the career advice on [Australian mathematician] Terry Tao's web page for myself! Also, everyone has a different style, and something that works for one person might not be so great for others," she said.

In the same interview, she said she spent her free time with family and her husband. "But for myself, I prefer solo activities; I enjoy reading and exercising in my free time," she said.

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

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 Vondrák, and daughter, Anahita.