Prime Minister Narendra Modi's Bharatiya Janata Party (BJP) will for the first time have a role in governing state of Jammu and Kashmir.
Modi, who stormed to power in May, 2014, personally addressed election rallies in the northern state in the run-up to the vote last December.
But no party won a clear majority. The BJP secured a record 25 seats, while the regional Peoples Democratic Party (PDP) won 28 seats in the state's 87-seat assembly.
Two months of complex negotiations between party leaders on how to share power concluded on Tuesday, with both sides finally agreeing to govern jointly, despite their differing ideologies.
Unlike the BJP, the PDP promotes a policy of self-rule for Jammu and Kashmir and of engaging in talks with militant separatists in the state.
The two sides have formed an alliance to work out a common programme that focuses on welfare and leaves aside traditionally contentious issues, including the size of the military's presence in the state.
"The deadlock that existed on some issues has been broken and we will form the government in Kashmir," BJP president Amit Shah told reporters in New Delhi.
Party officials in Srinagar said the BJP had agreed to sideline a long-standing pledge to scrap Article 370, a constitutional provision that grants the state special status and allows it to make its own laws.
The government will be headed by PDP leader Mufti Mohammad Sayeed for six years.
The two parties also agreed to form a committee to discuss the revocation of the Armed Forces' Special Powers' Act.