Attorney General Githu Muigai took many by surprise when he resigned on Tuesday as a new replacement was picked for his role as the principal legal adviser to the state.

Is there a story unfolding in your community? Let Hivisasa know

However, his resignation could not go without both positive and negative criticism from Kenya's leading opinion sharpers from both sides of the political divide.

Here are some of the sentiments shared on social media as the legal giant takes his last bow in the legal office.

“I wish to place on record, on my own behalf and on behalf of the people of Kenya, our gratitude for the committed and dedicated service that Professor Muigai has according to our nation over the last six and a half years that he has served in the office of Attorney General. I wish Professor Muigai all the very best in the next phase of his professional career,” read part of President Uhuru’s statement sent to newsrooms.

Former AG Githu Muigai is my friend & was my Professor but he disappointed me as our Attorney General ... He became a horse whisperer instead of Oracle to the King! He told the King what he wanted to hear instead of what the gods have said! An AG is s Prophet, not Court Jester!— Donald B Kipkorir (@DonaldBKipkorir).

President Uhuru Kenyatta says he has received with regret the resignation of Attorney General Githu Muigai. He has nominated Judge Paul Kihara Kariuki as new AG. He has also nominated Kennedy Ogeto as Solicitor General and appointed Njee Muturi as Deputy Chief of Staff.— Oliver Mathenge (@OliverMathenge).

I took a thirty minutes siesta to wake up to the subtly sad, but not so astonishing news of Githu Muigai ‘resigning’ as Attorney General and Kariuki Kihara replacing him in a hereditary way. Githu did not resign. The pompous poor Professor of law was fired; finally!— Nelson Havi (@NelsonHavi).

A section of political pundits has alleged that Mr Githu Muigai is set to become the next Director of Public Prosecution(DPP) which was left vacant after the predecessor Mr Keriako Tobiko resigned to join President Uhuru Kenyatta's cabinet.