The government spokesman , Gholamhossein Elham , told the official Islamic Republic News Agency on Saturday that Mr. Larijani , who was also secretary of the Supreme National Security Council , had offered to resign several times but that his resignation was finally accepted by Mr. Ahmadinejad .