In a now infamous private dinner on January 27, President Donald Trump allegedly told James Comey, the FBI director at the time, “I need loyalty, I expect loyalty.” Comey, by his own account, tried to wriggle out of the uncomfortable situation by promising “honest loyalty,” but not every government official has so successfully resisted the mob boss’ expectations. Michael Flynn, the former national security advisor, was one of Trump’s prime loyalists—and Trump repaid Flynn in kind, depending him well after anyone thought it politically sensible. But now their bond has been broken, as Flynn has flipped.

Flynn on Friday pleaded guilty to lying to the FBI about his conversations with Russian Ambassador Sergey Kislyak and reportedly has offered “full cooperation” with Robert Mueller’s investigation of the Trump campaign’s ties with Russia. He’s even willing to testify against his former boss, specifically that the president “directed him to make contact with the Russians, initially as a way to work together to fight ISIS in Syria,” according to ABC. “A close confidant told ABC News that Flynn felt abandoned by Trump in recent weeks, and told friends about the decision to make the plea deal within the last 24 hours as he grew increasingly concerned about crippling legal costs he would face if he continued to contest the charges.”

The severity of Flynn’s betrayal can only be appreciated by recalling how tight the president and his erstwhile adviser once were. Less than two days after Trump won the presidency, outgoing President Barack Obama warned Trump not to appoint Flynn. (Obama had fired Flynn as head of the Defense Intelligence Agency in 2014 for mismanagement.) Trump ignored Obama’s counsel, and offered Flynn the position of national security advisor; Flynn accepted. On January 4, Flynn revealed to the Trump transition team that the FBI was investigating for covertly lobbying for Turkey; Flynn was not fired. Three weeks later, on January 26, White House counsel Don McGahn was informed by then-acting Attorney General Sally Yates that Flynn was vulnerable to blackmail by the Russian government because he made false claims about his contact with them. Again, Flynn was not fired.

Flynn was eventually forced to resign, on February 13, after the story of his contacts with Kislyak, the Russian ambassador, were leaked. The next day, Trump met with Comey and told the FBI director, “I hope you can see your way clear to letting this go, to letting Flynn go. He is a good guy. I hope you can let this go.” The following day, during a press conference, Trump praised Flynn, saying, “General Flynn is a wonderful man. I think he’s been treated very, very unfairly by the media—as I call it, the fake media, in many cases. And I think it’s really a sad thing that he was treated so badly.” On March 31, Trump tweeted out support for the idea of granting Flynn immunity in exchange for testimony. Trump also repeatedly asked White House lawyers if he could contact Flynn. Trump was consistently told that it would be inappropriate, but in April he called Flynn anyway and told him, “Stay strong.”

The pattern is clear: Trump acted as Flynn’s protector, possibly in exchange for the expectation that Flynn would remain loyal by not testifying against the president.