The United Nations says Qatar's emir has pardoned and freed a poet imprisoned since 2013 over verses he wrote that apparently offended the government of the country's former ruler.

The U.N.'s Office of the High Commissioner for Human Rights told The Associated Press on Wednesday it has confirmed Muhammad ibn al-Dheeb al-Ajami's release through civil society groups working with his family. It said he received a royal pardon from Qatar's ruler, Sheikh Tamim bin Hamad Al Thani.

The poet's lawyer, Najeeb al-Nauimi, says he hasn't had any contact with al-Ajami since his release. Qatari government officials did not respond to requests for comment.

Al-Ajami was serving a 15-year prison sentence over a poem posted online in 2010. He was prosecuted under former emir, Sheikh Hamad bin Khalifa Al Thani.