WASHINGTON (Reuters) - The White House will take a lead role in crafting legislation to overhaul the U.S. tax code, eyeing an August target date as President Donald Trump seeks his first legislative victory following the failure last week of a long-promised bill to undo Obamacare.

Trump’s pledge to cut taxes, including a lowering of the rates paid by corporations, was a pillar of his 2016 presidential campaign and provided much of the fuel for the heady stock market rally that followed his Nov. 8 victory.

The White House said on Monday it was moving ahead with tax reform, calling it a “huge priority” for the Republican president and “something that he feels very strongly about.”

“Obviously, we’re driving the train on this,” White House spokesman Sean Spicer said during a briefing, adding, “We’re going to work with Congress on this.”

Spicer noted that Treasury Secretary Steven Mnuchin has talked about August as a target date for tax legislation, but said the timetable could slip depending on how quickly a consensus could be reached.

Getting a broad tax bill passed by Congress and on Trump’s desk to be signed into law will not be easy, especially after intra-party differences torpedoed the healthcare legislation, after the Trump administration fiercely lobbied for it.

Republicans for seven years had promised to dismantle Democratic former President Barack Obama’s Affordable Care Act, dubbed Obamacare, and the Trump administration made it its top priority when Trump took office in January.

But the effort collapsed on Friday when members of the Freedom Caucus, the most conservative lawmakers of the House of Representatives, refused to support the bill, which was also backed by House Speaker Paul Ryan.

The stinging defeat alarmed investors who began reassessing the chances for passage of the tax agenda this year. Major U.S. stock indexes opened sharply lower on Monday before paring losses, with the Dow Jones and the S&P 500 ending only moderately down.

President Trump walks from Marine One as he returns to the White House. REUTERS/Joshua Roberts

House Ways and Means Committee Chairman Kevin Brady, the top House Republican tasked with tax reform, said over the weekend that the White House should start with proposals already in the House instead of crafting a separate bill.

“My point is that the Trump tax plan and the House Republican plan started at 80 percent the same. It think it’s grown to 90 percent or better,” Brady told reporters on Monday.

“I think it’s critical for the White House and Republicans in Congress to agree on pro-growth tax reform together and move forward together as well,” he added.

DEMOCRATS MIGHT BE OPEN TO TALKS

Analysts at Bank of America Merrill Lynch predicted in a research note that a tax bill, “if passed at all, could be a very watered-down version of current proposals.”

The White House over the weekend dangled the idea of a compromise tax restructuring that could win support from moderate Democrats. White House chief of staff Reince Priebus on Sunday said such a package could include middle-class tax cuts.

Spicer on Monday remained vague on how much Trump would allow the federal deficit to grow as a result of the tax cuts.

“It’s a really early question to be asking at this point,” Spicer said.

The U.S. tax code has not undergone a major overhaul since 1986, during the administration of Republican President Ronald Reagan.

Democratic Senator Christopher Coons signaled his party would be open to discussing tax legislation if it was not merely a giveaway to the rich. Democrats had fought former President George W. Bush’s tax policies for that reason.

“If we have a move toward tax reform that could strengthen manufacturing, strengthen our exports and provide tax relief to the middle-class - not overwhelmingly to the wealthiest - there’s a menu for us to start talking about it,” the Delaware senator told MSNBC’s “Morning Joe” program.

Although winning over Democrats may be tough, the alternative - getting Republicans to vote as a bloc - could be a hard road in light of the healthcare rebellion by Republican lawmakers.

“Trump is stuck. He can’t cajole the arch conservatives in the Republican Party, and at the same time, my sense is the Democrats don’t want to throw him a bone either, so it is going to be difficult,” said Jack Ablin, chief investment officer at BMO Private Bank in Chicago.

One Republican lawmaker, Representative Tom Cole of Oklahoma, suggested Congress focus first on such things as getting a “realistic budget” done and passing legislation to raise the national debt ceiling.

“And then start on tax reform,” Cole told MSNBC’s “Morning Joe” program. “But start with real hearings and start in a way that everybody at least at the outset is a potential player.”

Representative Ted Poe of Texas, who resigned from the Freedom Caucus after the healthcare debacle, said that getting an infrastructure spending package - another key piece of Trump’s legislative agenda intended to spur economic growth - through Congress will be no “slam dunk.”

“It’s going to be very, very difficult,” Poe told CNN’s “New Day” program.