WASHINGTON — President Donald Trump on Tuesday ratcheted up pressure on Senate Republicans to quickly embrace and pass legislation carrying his domestic agenda, intensifying a battle inside the GOP about what should be in the measure and how much it should cost.

The deepening divisions are threatening the fate of the sprawling bill, which includes large tax cuts; reductions to Medicaid, food assistance and clean energy programs; and additional money for border security and the military. They erupted online Tuesday after Trump lashed out at an outspoken Republican opponent of the legislation and as Elon Musk, the tech billionaire who recently left his governmental role leading the Department of Government Efficiency, castigated its supporters, denouncing the bill as “a disgusting abomination.”

The back-and-forth highlighted the challenges facing Trump’s top domestic priority, which has prompted a searing debate in the GOP about policy priorities and how much additional debt the federal government should take on to address them.

Trump began the day lashing out on social media at Sen. Rand Paul, R-Ky., for refusing to back the bill, claiming that Paul had little understanding of the measure and adding: “His ideas are actually crazy (losers!). The people of Kentucky can’t stand him.”

“He loves voting ‘NO’ on everything, he thinks it’s good politics, but it’s not,” Trump wrote of Paul, calling the legislation a “big WINNER!”

Hours later, Musk panned the bill in his own social media posts.His broadside served as a shot in the arm for conservatives in Congress like Paul who are agitating for deeper spending cuts in the legislation and object to the estimated price tag of the bill, which is projected to add as much as $3 trillion to the debt over the next decade.

“I agree with Elon,” Paul wrote later in his own post, while Rep. Thomas Massie of Kentucky, one of just two House Republicans who voted against the measure, chimed in with a “He’s right.”

The dispute is playing out as Senate Republicans begin their work on the bill, following its passage in the House over solid Democratic opposition. Even as Johnson has implored senators not to make major changes that could jeopardize the measure’s chances of final approval in the House, they have made clear that they intend to put their own mark on the package.

“We’re anxious to have the ball and to run with it,” Sen. John Thune of South Dakota, the majority leader, said Tuesday.

“Obviously, we’re going to take a lot of input from our members and make sure that as we go through the process, it’s done in a way that incorporates the views of Republican senators,” he added.

Trump on Monday publicly urged Senate Republicans to move swiftly on the measure, touting its provisions cutting taxes, beefing up border enforcement and deportations, rolling back clean energy programs and scaling back Medicaid and food assistance, among others.

“I call on all of my Republican friends in the Senate and House to work as fast as they can to get this Bill to MY DESK before the Fourth of JULY,” Trump wrote.