Narendra Modi has taken the oath of office as India's prime minister at the start of a new era hailed by his Pakistani counterpart as an opportunity to end decades of regional instability.

Pranab Mukherjee, the president, administered the oath of office on Monday in front of heads of state from around the world, including the leaders of Bangladesh, Pakistan, Nepal, Maldives, Afghanistan and Sri Lanka.

"I, Narendra Damodardas Modi, swear in the name of God that I will maintain the integrity of India," Modi said in Hindi at the ceremony. "I will work without fear, anger or hatred and will do justice to all as per the codes of the constitution."

"It is a great moment and a great opportunity," said Nawaz Sharif, the Pakistani prime minister who was a guest at the ceremony.

"This is a chance to reach out to each other. Both governments have a strong mandate," Sharif told India's NDTV network, according to a transcript provided by the Pakistan High Commission.

"Both countries should rid the region of instability and security that has plagued us for decades."

RELATED: Modi: From tea boy to India's leader

The 63-year-old Modi is expected to steer India firmly to the right after a decade of Congress party rule.

Modi, the leader of the BJP, visited the memorial of Mahatma Gandhi on Monday, before then stopping to meet Atal Bihari Vajpayee, his party's only previous prime minister.

Modi announced his new cabinet before his inauguration.

"Keeping our commitment to 'minimum government, maximum governance' we have made an unprecedented and positive change in ministry formation," he also said on Twitter.

"Team Modi" would have 23 full-rank cabinet ministers, down from his predecessor Manmohan Singh's 28, while the number of junior ministers would be cut to 22, the reports said.

A new website for the prime minister stated that "together we will script a glorious future for India".

Al Jazeera's Sohail Rahman, reporting from New Delhi, said that during the ceremony it was expected that the country would come to a standstill.

"And indeed it was very quiet, people were glued to their television sets," he said.

The BJP secured the first majority since 1984 at the election, trouncing the scandal-plagued Congress on a promise of reviving manufacturing and investment to create millions of jobs.

Modi's pledge to overhaul the flagging economy won support, along with his rags-to-riches story and reputation as a clean and efficient chief minister of prosperous western Gujarat state.

Al Jazeera's correspondent said that whether that success translates at a national level and whether "the love affair with Narendra Modi continues or not remains to be seen".