By JULIE PACE and JONATHAN LEMIRE, Associated Press

WASHINGTON (AP) — Six months into his presidency, Donald Trump is saddled with a stalled agenda, a West Wing that resembles a viper's nest, a pile of investigations and a Republican Party that's starting to break away.

Trump on Friday indirectly acknowledged the troubled state of his unconventional White House when he abruptly replaced his chief of staff with hard-nosed retired Gen. John Kelly, until now the Homeland Security secretary.

Kelly will take the desk of Reince Priebus, a Republican operative who was skeptical of Trump's electoral prospects last year and ultimately came to be viewed by the president as weak and ineffective.

Kelly's ability to succeed will depend on factors outside his control, including whether Trump's squabbling staff is willing to put aside the rivalries that have sowed disorder and complicated efforts to enact policy.

But the big question is can Kelly do what Priebus couldn't? And that's curbing the president's penchant for drama and unpredictability, and his tendency to focus more on settling scores than promoting a policy agenda.

No other aide or adviser has been successful on that front.

As a candidate, and now as president, Trump has cycled through campaign chiefs and advisers but has remained easily distracted by his personal interests and only loosely tethered to any policy plans.

"Trump has spent a lot of his political capital on nothing but defending his own reputation," Alex Conant, a Republican strategist, said of Trump's first six months in office. "There is no sustained strategy. His attention seems to shift with whatever is leading cable news at that moment."

Staff shake-ups are a tried-and-true way for struggling presidents to signal that they are ready to shift course.

In 1994, President Bill Clinton elevated budget director Leon Panetta to chief of staff with a mandate to bring more discipline to a loosely organized White House. President George W. Bush made the same move with Josh Bolten in 2006 as the Bush presidency buckled under criticism of his handling of the Iraq war and the federal government's response to Hurricane Katrina.

Rarely, however, do presidents face as much turmoil as quickly as Trump has.

His Friday afternoon tweet announcing Kelly's hiring capped a tumultuous week:

—his new communications director, Anthony Scaramucci, spewed vulgarities in public at Priebus.

—Trump drew blunt criticism from GOP lawmakers over his attacks on Attorney General Jeff Sessions for withdrawing from the federal investigation into Russian campaign interference.

—Senate Republicans' efforts to pass legislation that would have overhauled the nation's health care law collapsed.

Some Trump allies tried to pin the blame for the health debacle on Priebus. The former Republican National Committee chairman had sold himself to Trump as a well-connected Washington operator who could help round up votes on Capitol Hill. He encouraged Trump to press forward with a health care overhaul early in his presidency.

But as Republicans sorted through the rubble of their health care failure, it was Trump, not his chief of staff, who was the target of criticism.

"One of the failures was the president never laid out a plan or his core principles and never sold them to the American people," said Rep. Charlie Dent, R-Pa. He said Trump "outsourced the whole issue to Congress."

Indeed, Trump's relatively rare public appeals for the passage of health legislation suggested he was more interested in a political win than in the details of policy. A former Democrat who does not adhere to all GOP orthodoxy, Trump frequently shifted his own stance as to whether the Republicans should repeal and replace the Affordable Care Act at once or simply repeal the law for now.

By week's end, it was clear that some Republicans simply weren't afraid of breaking with a weakened president. GOP Sens. Susan Collins of Maine, Lisa Murkowski of Alaska, and John McCain of Arizona, who was back in Washington after a brain cancer diagnosis, doomed a last-ditch bill in Friday's early morning hours.

Murkowski, who was targeted by Trump on Twitter for her opposition, showed little sign of being cowed by the president.

"We're here to govern, we're here to legislate, to represent people that sent us here. And so every day shouldn't be about campaigning. Every day shouldn't be about winning elections. How about doing a little governing around here?" she asked.

To this point, Trump has failed to shepherd a single substantial piece of legislation into law. His only major accomplishments have been by executive power — rolling back regulations and undoing a few of his predecessor's achievements, like the Paris climate treaty — along with his successful nomination of Supreme Court Justice Neil Gorsuch.

Kelly, who spent his career in the military before being nominated by Trump to run the sprawling Department of Homeland Security, has limited political and legislative experience. But at least for now, he has the trust of the president.

"He has been a true star of my administration," Trump declared.

___

Associated Press writers Alan Fram and Kevin Freking contributed to this report.

___

Follow Pace at http://twitter.com/jpaceDC and Lemire at http://twitter.com/@JonLemire

___

This story has been corrected to reflect that Leon Panetta was elevated by Bill Clinton to chief of staff from budget director, not from the Cabinet, and corrects the spelling of Josh Bolton's last name to Bolten.