The tension that has simmered in the Republican Party for years -- shutting down the government and nearly bringing the nation to default -- escalated into an outright civil war Tuesday. The conflict not only threatens the party's ability to make any realistic attempt at reclaiming the White House next month, but also previews the conflicts and divides that could consume the GOP for years to come if Trump loses.

On one side is Trump, who spent much of Tuesday lashing out on social media at his GOP foes, such as Speaker Paul Ryan and Sen. John McCain, and lamenting the lack of party unity. He's backed by conservative lawmakers including Iowa Rep. Steve King and the throngs of loyal supporters who attend his rallies, including the one here in Panama City, Florida, Tuesday, where he renewed his call for a government investigation into his opponent, Hillary Clinton.

Some are even raising the potential of denying Ryan the speakership after the election.

On the other side is Ryan, who is devoting the full resources of his stature to maintaining a congressional majority. That dominance of Capitol Hill is suddenly threatened -- and not just in the Senate, where there are many competitive races, but also in the House, where the GOP majority was considered untouchable until recently.

The infighting -- sparked by the release Friday of a 2005 video depicting Trump describing women in vulgar and sexually aggressive terms -- isn't likely to ease in the 27 days before Election Day. Trump made clear Tuesday that if he loses in November, he won't go down quietly -- or alone.

He began the day with a series of shots -- taken over Twitter -- at Ryan, saying it's hard to do well when the speaker isn't supportive. He followed up about an hour later calling Ryan a "weak and ineffective leader."

And nearly two hours after that, Trump posed his most explosive tweet of the day.

'Shackles have been taken off me'

"It is so nice that the shackles have been taken off me and I can now fight for America the way I want to," he said.

Trump continued his attacks on Ryan Wednesday during a rally in central Florida, where he said he's at a disadvantage when "you have leadership not putting their weight behind the people."

He also complained about getting no credit from party leaders for his Sunday night debate performance.

"Wouldn't you think Paul Ryan would call and say good job?" he said. "It got just about the largest audience for a second night debate in the history of the country. You'd think they'd say great going, Don, let's beat this crook. No, he doesn't."

Trump's turn on his own party may seem counterproductive -- it hardly allows him to improve his chances of catching Clinton. But it does allow him the satisfaction of vengeance against party leaders he believes have never treated him fairly since his stunning outsider campaign captured the nomination earlier this year.

And by blaming Republican leaders for their failure to wholeheartedly endorse his campaign, Trump also opens up the possibility of a face-saving excuse if he crashes to defeat in November.

But the cost to the Republican Party of Trump's burn-it-down-around-him strategy is already high, could become more extreme and potentially leave the GOP badly damaged long after he has left the political scene.

To begin with, the estrangement between Trump and the party leaders is blowing open a gaping split between the party's grass roots and its establishment leaders that Republican National Committee Chairman Reince Priebus and others worked so hard to bridge over the summer.

It is a divide that will be hard to overcome if Trump loses the election. Forging unity could be impossible if hordes of Trump voters blame party leaders for the defeat of a man who electrified the grass roots supporters in a way no other Republican has managed in decades.

King, the Iowa Republican congressman, warned Tuesday that a purge of party elites might be necessary, saying "the establishment wing of the party could simply be amputated out in this effort that's going on right now."

"They've gone so far out on this limb," King said on the Laura Ingraham radio show.

The meltdown in the GOP is the culmination of forces that have been building for years. Intense antipathy towards congressional leaders over their failure to more forcefully oppose President Barack Obama gave rise to the Tea Party and sent waves of anti-establishment lawmakers to Washington in successive elections.

Trump's adoption of a factually-challenged style of campaigning would have been impossible without the power of conservative media that has been building for decades and is now fused with the GOP presidential ticket through the role of Stephen Bannon, the head of Breitbart News, who serves as the CEO of the Trump campaign.

Trump's turn against his own party could also reverberate in down-ballot races. Republicans have long known that their hold on the Senate was tenuous -- whoever ran at the top of their ticket -- but Trump's slumping poll numbers now threaten to drag down vulnerable incumbents too.

Cutting into GOP majority

At the very least, a Trump implosion that cuts deeply into Ryan's majority could complicate the Speaker's already tough task of corralling his volatile majority coalition. If an anti-Trump landslide sweeps away House GOP members in more moderate districts, it could hand more relative power to the ultra-conservative Freedom Caucus and give him the same kinds of fits that it imposed on John Boehner, his predecessor.

Photos: Donald Trump's rise Photos: Donald Trump's rise President-elect Donald Trump has been in the spotlight for years. From developing real estate and producing and starring in TV shows, he became a celebrity long before winning the White House. Hide Caption 1 of 37 Photos: Donald Trump's rise Trump at age 4. He was born in 1946 to Fred and Mary Trump in New York City. His father was a real estate developer. Hide Caption 2 of 37 Photos: Donald Trump's rise Trump, left, in a family photo. He was the second-youngest of five children. Hide Caption 3 of 37 Photos: Donald Trump's rise Trump, center, stands at attention during his senior year at the New York Military Academy in 1964. Hide Caption 4 of 37 Photos: Donald Trump's rise Trump, center, wears a baseball uniform at the New York Military Academy in 1964. After he graduated from the boarding school, he went to college. He started at Fordham University before transferring and later graduating from the Wharton School, the University of Pennsylvania's business school. Hide Caption 5 of 37 Photos: Donald Trump's rise Trump stands with Alfred Eisenpreis, New York's economic development administrator, in 1976 while they look at a sketch of a new 1,400-room renovation project of the Commodore Hotel. After graduating college in 1968, Trump worked with his father on developments in Queens and Brooklyn before purchasing or building multiple properties in New York and Atlantic City, New Jersey. Those properties included Trump Tower in New York and Trump Plaza and multiple casinos in Atlantic City. Hide Caption 6 of 37 Photos: Donald Trump's rise Trump attends an event to mark the start of construction of the New York Convention Center in 1979. Hide Caption 7 of 37 Photos: Donald Trump's rise Trump wears a hard hat at the Trump Tower construction site in New York in 1980. Hide Caption 8 of 37 Photos: Donald Trump's rise Trump was married to Ivana Zelnicek Trump from 1977 to 1990, when they divorced. They had three children together: Donald Jr., Ivanka and Eric. Hide Caption 9 of 37 Photos: Donald Trump's rise The Trump family, circa 1986. Hide Caption 10 of 37 Photos: Donald Trump's rise Trump uses his personal helicopter to get around New York in 1987. Hide Caption 11 of 37 Photos: Donald Trump's rise Trump stands in the atrium of the Trump Tower. Hide Caption 12 of 37 Photos: Donald Trump's rise Trump attends the opening of his new Atlantic City casino, the Taj Mahal, in 1989. Hide Caption 13 of 37 Photos: Donald Trump's rise Trump signs his second book, "Trump: Surviving at the Top," in 1990. Trump has published at least 16 other books, including "The Art of the Deal" and "The America We Deserve." Hide Caption 14 of 37 Photos: Donald Trump's rise Trump and singer Michael Jackson pose for a photo before traveling to visit Ryan White, a young child with AIDS, in 1990. Hide Caption 15 of 37 Photos: Donald Trump's rise Trump dips his second wife, Marla Maples, after the couple married in a private ceremony in New York in December 1993. The couple divorced in 1999 and had one daughter together, Tiffany. Hide Caption 16 of 37 Photos: Donald Trump's rise Trump putts a golf ball in his New York office in 1998. Hide Caption 17 of 37 Photos: Donald Trump's rise An advertisement for the television show "The Apprentice" hangs at Trump Tower in 2004. The show launched in January of that year. In January 2008, the show returned as "Celebrity Apprentice." Hide Caption 18 of 37 Photos: Donald Trump's rise A 12-inch talking Trump doll is on display at a toy store in New York in September 2004. Hide Caption 19 of 37 Photos: Donald Trump's rise Trump attends a news conference in 2005 that announced the establishment of Trump University. From 2005 until it closed in 2010, Trump University had about 10,000 people sign up for a program that promised success in real estate. Three separate lawsuits -- two class-action suits filed in California and one filed by New York's attorney general -- argued that the program was mired in fraud and deception. Trump's camp rejected the suits' claims as "baseless." And Trump has charged that the New York case against him is politically motivated. Hide Caption 20 of 37 Photos: Donald Trump's rise Trump attends the U.S. Open tennis tournament with his third wife, Melania Knauss-Trump, and their son, Barron, in 2006. Trump and Knauss married in 2005. Hide Caption 21 of 37 Photos: Donald Trump's rise Trump wrestles with "Stone Cold" Steve Austin at WrestleMania in 2007. Trump has close ties with the WWE and its CEO, Vince McMahon. Hide Caption 22 of 37 Photos: Donald Trump's rise For "The Apprentice," Trump was honored with a star on the Hollywood Walk of Fame in January 2007. Hide Caption 23 of 37 Photos: Donald Trump's rise Trump appears on the set of "The Celebrity Apprentice" with two of his children -- Donald Jr. and Ivanka -- in 2009. Hide Caption 24 of 37 Photos: Donald Trump's rise Trump poses with Miss Universe contestants in 2011. Trump had been executive producer of the Miss Universe, Miss USA and Miss Teen USA pageants since 1996. Hide Caption 25 of 37 Photos: Donald Trump's rise In 2012, Trump announces his endorsement of Republican presidential candidate Mitt Romney. Hide Caption 26 of 37 Photos: Donald Trump's rise Trump speaks in Sarasota, Florida, after accepting the Statesman of the Year Award at the Sarasota GOP dinner in August 2012. It was shortly before the Republican National Convention in nearby Tampa. Hide Caption 27 of 37 Photos: Donald Trump's rise Trump appears on stage with singer Nick Jonas and television personality Giuliana Rancic during the 2013 Miss USA pageant. Hide Caption 28 of 37 Photos: Donald Trump's rise In June 2015, during a speech from Trump Tower, Trump announced that he was running for President. He said he would give up "The Apprentice" to run. Hide Caption 29 of 37 Photos: Donald Trump's rise Trump -- flanked by U.S. Sens. Marco Rubio, left, and Ted Cruz -- speaks during a CNN debate in Miami on March 10. Trump dominated the GOP primaries and emerged as the presumptive nominee in May. Hide Caption 30 of 37 Photos: Donald Trump's rise The Trump family poses for a photo in New York in April. Hide Caption 31 of 37 Photos: Donald Trump's rise Trump speaks during a campaign event in Evansville, Indiana, on April 28. After Trump won the Indiana primary, his last two competitors dropped out of the GOP race. Hide Caption 32 of 37 Photos: Donald Trump's rise Trump delivers a speech at the Republican National Convention in July, accepting the party's nomination for President. "I have had a truly great life in business," he said. "But now, my sole and exclusive mission is to go to work for our country -- to go to work for you. It's time to deliver a victory for the American people." Hide Caption 33 of 37 Photos: Donald Trump's rise Trump faces Democratic nominee Hillary Clinton in the first presidential debate, which took place in Hempstead, New York, in September. Hide Caption 34 of 37 Photos: Donald Trump's rise Trump apologizes in a video, posted to his Twitter account in October, for vulgar and sexually aggressive remarks he made a decade ago regarding women. "I said it, I was wrong and I apologize," Trump said, referring to lewd comments he made during a previously unaired taping of "Access Hollywood." Multiple Republican leaders rescinded their endorsements of Trump after the footage was released. Hide Caption 35 of 37 Photos: Donald Trump's rise Trump walks on stage with his family after he was declared the election winner on November 9. "Ours was not a campaign, but rather, an incredible and great movement," he told his supporters in New York. Hide Caption 36 of 37 Photos: Donald Trump's rise Trump is joined by his family as he is sworn in as President on January 20. Hide Caption 37 of 37

The dilemma is especially difficult for Republican senators running for re-election. Some are rejecting Trump because of revulsion at his remarks among more moderate voters. But at the same time, they risk alienating Trump supporters in states's where the former reality star racked up high margins in the primary race.

New Hampshire Sen. Kelly Ayotte fits into this category and her desperate effort to walk the fine line between condemning and embracing Trump during this election has become a symbol of the wider GOP conundrum. Ayotte finally said she could not vote for Trump after the video emerged on Friday.

But another star of the GOP, Florida Sen. Marco Rubio, said Tuesday he's not yet ready to back away from Trump. Rubio looks certain to need Trump voters to maintain his narrow lead in his re-election race. But at the same time, if more explosive video emerges about Trump, Rubio, who has presidential ambitions in his future, risks being tarnished by association with the Republican nominee.

Another lawmaker in a tough re-election race who is hedging his bets is North Carolina GOP Sen. Richard Burr, who said that while Trump's comments were "indefensible," he still plans to support him.

Risks for Clinton

For her part, the turmoil consuming the GOP would seem to provide a substantial boost to Clinton's White House bid. An NBC News/Wall Street Journal poll released Tuesday found the Democratic nominee enjoying a 9-point lead among likely voters in a four-way race.

But her aides caution against excessive optimism. There's concern inside the campaign that an increasingly negative race -- which could only become darker in the days ahead -- could turn off voters and make them less likely to show up at the polls. In that instance, a lower turnout could create an advantage for Trump.

"This seems to be their strategy, disgust everyone with our democratic dialogue so that they won't come out to the polls," John Podesta, Clinton's campaign chairman, told reporters Tuesday. "I think it is very unbecoming a presidential candidate."

Clinton said as much herself during an interview with a Florida radio station Tuesday.

"Despite all of the terrible things (Trump) has said and done, he is still trying to win this election," she said. "And we cannot be complacent, we cannot rest."