By Rajesh Kumar Singh and Manoj Kumar

NEW DELHI (Reuters) - It took him more than two years, but Indian Prime Minister Narendra Modi has finally discovered the art of the deal.

Realizing that a frontal assault wasn't securing the votes needed for India's biggest-ever tax reform, Modi and Finance Minister Arun Jaitley changed tack this spring, government and ruling party sources have told Reuters.

First, they sought to build a coalition among the nation's 29 state governments to isolate the Congress party, which despite losing heavily to Modi in 2014 had blocked a new Goods and Services Tax (GST) in the upper house of parliament.

Then, Jaitley held a series of meetings with Congress leaders whose outcome was uncertain right up to the last minute, sources close to the finance minister said.

He yielded to their demands - accepting, verbatim, a clause they proposed for the constitutional amendment needed to make the GST happen, according to a member of the Congress team that included former Finance Minister P. Chidambaram.

"Negotiations take place only if both sides are willing to be flexible," senior Congress leader Jairam Ramesh told Reuters. "Both sides were pragmatic."

An aide to Jaitley said Congress's growing isolation proved decisive in making a compromise possible.

"They had got themselves into a corner," said the finance ministry official, who was privy to the talks. "They had two options: strike a deal and come out with your reputation intact, or lose your credibility."

Last week's unanimous upper-house vote to pass the 122nd amendment to the Indian constitution brings the wheel full circle - the GST was proposed by Chidambram a decade ago but was stalled by political rivalry.

Introducing a unified sales tax across India's market of 1.3 billion people would mark a bold act of integration at a time of disintegration elsewhere, as Britain exits the European Union and a protectionist, Donald Trump, runs for the U.S. presidency.

The GST vote also addresses how India, as a federation, can implement a one-size-fits-all sales tax - something the United States and EU have been unable to do - by creating a GST Council that brings the center and the states together.

Tough bargaining on the rate and scope of the tax lies ahead, yet at least the atmosphere has improved, with Chidambram praising Jaitley's "friendly and conciliatory tone".

That could revive projects that foundered early in Modi's rule, including land and labor reforms.

EARLY STANDOFF

Despite winning India's biggest mandate in 30 years, Modi has struggled to advance his agenda.

Congress, though reduced to a rump opposition, has resisted. As the largest party in the upper house that represents the states, it had blocked the GST and derailed Modi's land acquisition bill which critics branded as being "anti-farmer".

While that tactic proved effective, it wasn't winning public support. Congress took hits in state elections and in June lost the upper house votes it needed to be sure of stopping the GST.

This was the cue for Jaitley to court the states, with key swing state West Bengal soon declaring its support. In July, he targeted Bihar, while at the same time re-engaging with Congress after nine months of radio silence.

Jaitley's promise to the states to compensate revenue losses for five years, made at talks in New Delhi on July 26, won them over, West Bengal's finance minister Amit Mitra told Reuters.

Congress moved to cut a deal, while Modi and Jaitley were ready to offer concessions - including scrapping a levy of 1 percent on the movement of goods between states - that experts say would actually make the GST a better tax.

On the morning of July, 27 Congress submitted a written proposal, with new wording on resolving GST disputes between the center and the states. Modi's cabinet approved identical tweaks that same evening.

When it came to the Aug. 3 vote, there were 203 votes in favor, and none against. The amendment passed the lower house on Monday, also unanimously.

It was a first for Modi, who called the GST a "Great Step towards Transformation".

(Additional reporting by Subrata Nagchoudhury in Kolkata and Jatindra Dash in Bhubaneswar; Writing by Douglas Busvine; Editing by Kim Coghill)