For months, it looked as if the long-feared stalemate in Libya would last indefinitely. Late last week, however, developments shifted with surprising speed, and as I type, the fall of the Gaddafi regime appears imminent.

The first real indication of a dramatic shift came Thursday, when rebel fighters easily overtook government soldiers at an oil refinery in Zawiyah, just outside Tripoli. This was followed by some high-profile defections of Gaddafi loyalists, who apparently saw the writing on the wall.

And over the weekend, the Gaddafi regime appeared to quickly fall apart.

Col. Muammar el-Qaddafi’s grip on power dissolved with astonishing speed on Monday as rebels marched into the capital and arrested two of his sons, while residents raucously celebrated the prospective end of his four-decade-old rule. Colonel Qaddafi’s precise whereabouts remained unknown and news reports said loyalist forces still held pockets of the city, stubbornly resisting the rebel advance.

In the central Green Square, the site of many manufactured rallies in support of Colonel Qaddafi, jubilant Libyans tore down posters of him and stomped on them. The rebel leadership announced that the elite presidential guard protecting the Libyan leader had surrendered and that their forces controlled many parts of the city, but not Colonel Qaddafi’s leadership compound.

By all accounts, the Gaddafi regime has not yet collapsed; the whereabouts of the bizarre leader are unknown; and forces loyal to the dictator still control portions of Tripoli. Fighting continues this morning.

But everyone involved appears to be preparing for the transition to a post-Gaddafi Libya. President Obama issued a statement late last night, saying, “Tonight, the momentum against the Qadhafi regime has reached a tipping point. Tripoli is slipping from the grasp of a tyrant. The Qadhafi regime is showing signs of collapsing. The people of Libya are showing that the universal pursuit of dignity and freedom is far stronger than the iron fist of a dictator…. The future of Libya is now in the hands of the Libyan people.”

There are, to be sure, significant hurdles ahead. Not only are there still clashes in the capital, but rebels do not yet have a clear leader who can represent multiple factions. What’s more, Gaddafi would not exactly leave behind strong structures of a civil society.

But it’s hard not to feel a sense of satisfaction by the weekend’s developments. The reign of a brutal dictator is nearing its end, and his downfall is welcome news.

NBC News’ Richard Engel noted this morning that this is nothing like the fall of Saddam Hussein in Baghdad — there, it was U.S. forces who took the capital, while Iraqis began looting. In Tripoli, it’s Libyans who are taking Tripoli.

Steve Benen

Follow Steve on Twitter @stevebenen. Steve Benen is a producer at MSNBC's The Rachel Maddow Show. He was the principal contributor to the Washington Monthly's Political Animal blog from August 2008 until January 2012.