Pakistan Prime Minister Imran Khan was trolled on Twitter. (FILE PHOTO)

Pakistan Prime Minister Imran Khan on Wednesday was trolled after he posted a quote by Rabindranath Tagore on his official Twitter account, but attributed it to Lebanese writer and poet Kahlil Gibran.

Mr Khan posted the inspirational quote on Twitter that read, "I slept and I dreamed that life is all joy. I woke and I saw that life is all service. I served and I saw that service is joy."

He captioned the quote saying: "Those who discover and get to understand the wisdom of Gibran's words, cited below, get to live a life of contentment."

The original quote, "I slept and dreamt that life was joy. I awoke and saw that life was service. I acted and behold, service was joy," however, is by Nobel laureate Rabindranath Tagore.

But Twitter was unforgiving.

"Prime Minister, I think these are Tagore's words," Pakistani journalist Azhar Abbas replied to the tweet.

"Is he really prime minister or what, don't even check whose quote it is before tweeting philosophy related to quote," another tweet read.

"Nice quotes but these are Shri Rabindranath Tagore's words," Twitter user Manoj Agrawal said. Another Twitter user added: "Khan saheb, this is Tagore's quote. You seriously need an educated and informed social media team."

The Pakistani Prime Minister was trolled earlier this month after he "broke protocol" when he met Saudi King Salman bin Abdulaziz at the Organisation of Islamic summit. In a video widely shared on Twitter, Mr Khan was seen speaking to the Saudi King's interpreter, and then walking off before the message could be translated, leaving the Saudi King alone. He was severely criticised, both by his countrymen and citizens of Saudi Arabia, for apparently disrespecting the king.

He also made a gaffe at the Shanghai Cooperation Organisation Summit held in Bishkek last week, when he was sitting while everyone else stood to welcome the head of states entering the hall at the opening ceremony of the celebrated summit.