Attorney General Fida M Kamal resigned Wednesday for what he said was personal reason.
After hours of a meeting with law adviser AF Hassan Ariff at the law ministry, Kamal told reporters: "I have placed my resignation letter."
"It has been difficult for me under these circumstances to work with dignity and integrity."
"I cannot continue."
Kamal did not explain "the circumstances" under which he was forced to resign.
Kamal was appointed as the government's top law officer on Feb 5, 2007.
Prior to the current position, he had worked as additional attorney general.
His resignation came days after the High Court ruled that the president cannot promulgate an ordinance if it is not extremely necessary and has no immediate connections to the elections during the rule of the caretaker government.