An incredible thing happened this week: A bill written by Sen. Ted Cruz (R-Tex.) has passed Congress.

Sen. Ted Cruz, (R-Tex.) (AP Photo/Carolyn Kaster, File)

It's a notable accomplishment in an institution accustomed to taking months, if not years, to pass legislation. And it's even a more notable accomplishment for a senator considered by many to be the embodiment of partisan gridlock and who has been frank about his disinterest in going along to get along on Capitol Hill.

Here's how it happened.

Cruz quickly and quietly worked to unveil a proposal in recent days that would ban Iran's recently appointed ambassador to the United Nations from entering the United States. He spent last weekend negotiating with New York Sen. Charles E. Schumer, the third-ranking Senate Democrat and a vocal critic of the Iranian government. Over the course of those conversations, the senators agreed to tweak Cruz's bill to make it amenable to Democrats, who on Monday night passed the bill unanimously and without debate.

These days, getting a bill passed by either chamber is enough of an accomplishment for most lawmakers. But Cruz quickly identified a House sponsor, Colorado Republican Rep. Doug Lamborn, who took up the cause and convinced House GOP leaders to bypass the committee process and allow for a quick vote. The measure passed unanimously on Thursday without debate as House lawmakers left town for a two-week recess.

To be sure, the issue Cruz chose to champion -- blocking a well-known Iranian figure from entering the United States -- is an easy one to win. And Cruz didn't get his bill passed on his own. He relied on Schumer and Lamborn  as well as Senate and House leaders, who saw the political benefit of quickly passing legislation that needled the Iranian regime. Support for stiff sanctions on Iran remains high on Capitol Hill, despite the Obama administration's decision to continue diplomatic negotiations in hopes of curbing Iran's nuclear program. Cruz's bill was a way to make Capitol Hill's position clear without Democrats having to directly oppose their president. (Even though the bill passed unanimously, there's no guarantee that President Obama will sign the bill. White House Press Secretary Jay Carney demurred when asked about it Thursday.)

But no matter. Cruz can now spend the two-week recess touting his accomplishment -- and may end up using it as a way to distinguish himself from other Republican lawmakers considering a White House bid in 2016. The budget proposal written by Rep. Paul Ryan (R-Wis.), passed the House Thursday on a party-line vote and will never earn a vote in the Democratic-controlled Senate. Sen. Marco Rubio (R-Fla.) has distanced himself from his most notable legislative accomplishment, a bipartisan immigration reform bill that passed the Senate but continues to languish in the House. And attempts by Sen. Rand Paul (R-Ky.) to amend or pass legislation have come up short.

Many people in both parties still hold a grudge against Cruz and blame him for helping force -- if not at least prolong -- last year's government shutdown. But this week Cruz played by the rules and won. Will he do it again? Stay tuned.