TEHRAN - Iran President Hassan Rouhani's son-in-law resigned on Monday just two days after his appointment as head of Iran's geological survey sparked accusations of nepotism, official news agency IRNA reported.

Kambiz Mehdizadeh, in his early thirties and reportedly married to Rouhani's daughter in a low-key wedding this August, was appointed to the senior position in the industries and mining ministry on Saturday.

The move sparked criticism on social media and from some lawmakers.

"I thank you for finding me worthy and inviting me to work alongside you in this ministry, but I ask to be relieved of my service so that I can continue my scientific and research activities," Mehdizadeh wrote in a resignation letter, according to IRNA.

Mehdizadeh is a PhD student in petroleum engineering, who has also served as an advisor to Iran's Oil Ministry, taekwondo federation and national youth organisation, according to the conservative Tasnim news agency.

The minister who appointed him, Reza Rahmani, defended his choice just hours before the resignation, saying Mehdizadeh was "chosen based on his competence and being the president's son-in-law had nothing to do with it," according to IRNA.

Iranians on social media renewed criticism of nepotism that had spread last year with the hashtag "#good-genes" — a reference to the son of a prominent reformist politician who attributed his business success to inheriting "good genes" from his parents.