(Recasts first paragraph, adds Pence, Toomey comments, stock market activity)
WASHINGTON, July 10 (Reuters) - President Donald Trump on Monday prodded the Republican-led U.S. Congress to pass major healthcare legislation but huge obstacles remained in the Senate as key lawmakers in his party voiced pessimism about the chances of rolling back the Obamacare law.
The House of Representatives approved its healthcare bill in May but the Senate's version appeared to be in growing trouble as lawmakers returned to Washington from a week-long recess.
"I cannot imagine that Congress would dare to leave Washington without a beautiful new HealthCare bill fully approved and ready to go!" Trump wrote on Twitter, referring to the seven-year Republican quest to dismantle Democratic former President Barack Obama's signature legislative achievement.
Trump appeared to be referring to the August recess that lawmakers typically take.
Senate Republican leaders have faced a revolt within their ranks, with moderate senators uneasy about the millions of Americans forecast to lose their medical insurance under the legislation and hard-line conservatives saying the bill leaves too much of Obamacare intact.
Republican Senator Pat Toomey said a new version of the legislation is expected to be released on Monday, telling the CNBC program "Squawk Box" that "there's a shot" of getting to the 50 votes his party needs to win passage in the 100-seat Senate, with Vice President Mike Pence casting a tie-breaking vote.
Repealing and replacing the Affordable Care Act, dubbed Obamacare, was a central campaign pledge for Trump.
Obamacare expanded health insurance coverage to some 20 million people, with much of the increase due to an expansion of the Medicaid government health insurance program for the poor and disabled.
Republicans criticize the law as a costly government intrusion into the healthcare system while Democrats call the Republican legislation a giveaway to the rich that will hurt millions of the most vulnerable Americans.
"The Senate now is literally within weeks of being able to deliver on that promise to the American people," Pence said in an interview with conservative radio host Laura Ingraham, adding there is "not yet agreement" in the Senate "but we are close."
Some Republican lawmakers were more pessimistic, with Senator John McCain saying on Sunday the legislation is "probably going to be dead."
Opponents of the legislation are expected to hold protests in Washington, organizing sit-ins at congressional offices, holding marches and stage vigils outside Republican senators' homes. During last week's recess, liberal groups organized town hall meetings and protests and ran advertisements criticizing the bill.
Senate Majority Leader Mitch McConnell faces the tricky task of crafting a bill that can attract Republican moderates and hard-line conservatives in a chamber his party controls with a slim 52-48 majority.
The Senate legislation would phase out the Medicaid expansion, drastically cut federal Medicaid spending beginning in 2025, repeal most of Obamacare's taxes, end a penalty on Americans who do not obtain insurance and overhaul Obamacare's subsidies to help people buy insurance with tax credits.
The nonpartisan Congressional Budget Office, which assesses the impact of legislation, has estimated 22 million people would lose health insurance over the next decade under the Senate bill.
Shares of U.S. hospital companies and health insurers, which have been particularly sensitive to developments involving the healthcare legislation, were mixed in midday trading on Monday.
Among hospital stocks, Tenet Healthcare Corp edged up 0.3 percent while HCA Healthcare Inc fell 0.5 percent.
Insurer Anthem Inc inched up 0.1 percent while Centene Corp, an insurer focused on Medicaid, was flat.
The broader S&P 500 healthcare sector was off 0.1 percent, underperforming a 0.2 percent gain for the overall S&P 500.
(Additional reporting by Doina Chiacu; Writing by Will Dunham; Editing by Tom Brown)