US President Barack Obama congratulated Narendra Modi and said he was looking forward to working with him after he was sworn in as Indian prime minister on Monday.

"As the president and prime minister agreed in their call after the election, as the world's two largest democracies, India and the United States share a deep bond and commitment to promoting economic opportunity, freedom, and security for our people and around the world," a White House statement said.

"We look forward to working closely together with the new government to continue to strengthen and expand the US-India strategic partnership for years to come."

The US State Department has said that Modi will face no problems visiting the United States as prime minister because he will receive a special A-1 visa as a head of government.

Earlier, a ceremony involving military bands, Hindu holy men and a vegetarian high tea was laid on at the president's mansion on Monday for Narendra Modi's swearing-in as prime minister of the world's largest democracy.

Modi and his ministers took their oaths at Rashtrapati Bhavan, a colonial-era sandstone mansion with 340 rooms in the heart of New Delhi.

Around 4,000 guests were invited, ranging from members of India's outgoing Nehru-Gandhi dynasty to top industrialists, Bollywood actors and the leaders of India's neighbours - including arch-rival Pakistan.

India's swearing-in ceremonies traditionally take place in the mansion's former ballroom, but Modi and his ministers took their oaths at an open-air event in its sweeping forecourt, in order to accommodate the unusually big audience.

The forecourt, covered in red carpets for the event, was heavily guarded with snipers on the rooftops of the mansion and some of the surrounding buildings. Military bands played bagpipes at the mansion's entrance.

Those in the crowd at the early evening ceremony included Sri Sri Ravi Shankar, a Hindu guru popular with India's middle class.

Modi arrived on time in a grey SUV, impeccably dressed in a beige waistcoat over a long white shirt. During the 90-minute-long ceremony, BJP workers at the party's nearby national headquarters set off fireworks in celebration.

As per tradition, the president's office was only due to disclose which ministers would run which ministries after the ceremony. Modi is a highly private figure and even senior party leaders have been kept in the dark about his plans, prompting a week of frantic guessing games in Delhi's political circles.