Image copyright AFP Image caption Mr Modi (left) and Mr Sharif (right) are both political conservatives but relations between their countries are fraught with suspicion

Pakistan's Prime Minister Nawaz Sharif is to attend the inauguration of Narendra Modi as Prime Minister of India on Monday.

It is the first time since the two countries won independence in 1947 that a prime minister from one state will attend such a ceremony in the other.

The two nuclear-armed rivals have fought three wars in the past 60 years.

Mr Modi is seen as a hardliner on national security issues. His BJP party advocates a tough stance on Pakistan.

But correspondents say his huge election victory gives him a mandate to reach out to Pakistan in a way the previous administration could not.

Bilateral ties suffered badly in the wake of the 2008 attacks in the Indian city of Mumbai, when 166 people were killed by Pakistani gunmen.

Relations improved slightly under outgoing PM Manmohan Singh, but there are still regular skirmishes on the disputed border in Kashmir.

Mr Singh was invited to Mr Sharif's inauguration last year but did not attend.

Analysis from the BBC's Kim Ghattas, in Islamabad

People close to Pakistan's prime minister say he was keen to accept the invitation but it was still a tough decision to make. Turning down Mr Modi's gesture of friendship could have caused renewed tensions between the two countries. But Mr Modi is also viewed warily here, because of his hardline Hindu nationalist positions. And Pakistan's military has not been keen on Mr Sharif's own efforts to improve ties with archrival India.

His decision to travel to Delhi will add to the already growing tension between Pakistan's civilian leadership and the powerful army. Mr Sharif's determination to prosecute former president and army chief Pervez Musharraf and his decision to pursue peace talks with the Taliban are also a source of friction with the army.

Mr Modi and Mr Sharif are both political conservatives who campaigned on pro-business platforms.

However, many Pakistanis view Mr Modi, a Hindu nationalist, with suspicion.

As chief minister of the state of Gujarat, he was accused of doing little to stop the violence during the 2002 communal riots in which more than 1,000 people - mostly Muslims - died.

Mr Modi has always denied the accusations and was never charged.

Image copyright Getty Images Image caption Wagah is the only land border crossing between India and Pakistan - it is formally opened and closed each day

India-Pakistan relations

1947: Independence from British colonial rule and partition - hundreds of thousands die in widespread communal bloodshed

1948, 1965, 1971: Wars between India and Pakistan

1989: Insurgency breaks out in Indian-administered Kashmir - India accuses Pakistan of supplying militants

1996-97: India and Pakistan make diplomatic efforts to defuse crisis in Kashmir

1998: Both sides carry out nuclear tests

1999: Clashes between Pakistan-backed forces and Indian military around Kargil, Indian-administered Kashmir - more than 1,000 killed on both sides

2001: Militants attack Indian parliament - threat of war defused after a stand-off lasting months

2003: Ceasefire on the Line of Control dividing Kashmir

2008: 166 people killed in Mumbai by Pakistani gunmen

Editor's note: this story was originally published on 24 May 2014. A minor update was made on 27 May, changing the date on the story.