Maryam Mirzakhani
A picture taken in the capital Tehran on July 16, 2017 shows the front pages of Iranian newspapers bearing portraits of the top female scientist Maryam Mirzakhani, who died of cancer a day earlier. Iranian-born mathematician, who became the first woman to win the coveted Fields Medal in 2014, died on July 15 in a US hospital after the breast cancer she had been battling for four years spread to her bone marrow, at the age of 40.ATTA KENARE/AFP/Getty Images

Maryam Mirzakhani of Iran, the first woman recipient of the Fields Medal for mathematics, died here at the age of 40.

The Stanford University professor died on Saturday after a four-year battle with cancer, reports Efe news.

Mirzakhani's friend and compatriot, NASA scientist Firouz Naderi, mourned her death on Twitter.

"A light was turned off today. It breaks my heart... gone far too soon," he wrote, while Iranian President Hassan Rouhani called Mirzakhani's death "very much heartrending".

Created in 1936, the Fields Medal, popularly known as the "Nobel Prize for Mathematics", is awarded every four years to a maximum of four mathematicians under the age of 40.

In 2014, Mirzakhani became both the first woman and the first Iranian to receive the honour, in recognition of "her outstanding contributions" in the area of complex geometry.

Born in 1977, Mirzakhani won two gold medals in the International Mathematical Olympiad during her teenage years and graduated from the Sharif University of Technology in Tehran in 1999 before going on to earn a doctorate from Harvard.

Mirzakhani is survived by her husband and their daughter.