Elation for Joanna Lumley and Nick Clegg but embarrassment for Gordon Brown
By Gary O'Donoghue
Political correspondent, BBC News
Oh dear, what a few days for the prime minister.
Having failed to build a consensus on MPs' expenses and having riled his own backbenchers in the process, he has suffered the humiliation of being the first premier to lose an opposition day debate in the Commons in 30 years.
James Callaghan was prime minister the last time it happened, in January 1978.
Now Gordon Brown doesn't enjoy the thumping great majorities that Tony Blair was able to bask in during his first two terms.
But a working majority of 63 is a decent enough margin that should allow you to carry your will.
While 27 Labour rebels joined the Liberal Democrats and the Conservatives on Wednesday, the real damage is the vast number of Labour MPs who decided to defy a three line whip and simply sit on their hands and abstain.
Challenge to authority
It's one thing voting against your government on a matter of principle over some bit of legislation you don't like, but it is quite another to see them go down in the face of an opposition sponsored motion.
It raises the highly corrosive idea that the PM's authority might be draining away.
The mood among Labour MPs is gloomy to say the least with many taking the clear view that the next election is already lost.
Strictly, this vote means nothing in concrete terms. It changes no laws and places no obligations on the government.
But the reality is different.
At time of writing the home secretary is preparing the government's response and it is unimaginable that she will simply attempt to brush this defeat off.
Ministers do believe that they have done a great deal for the Gurkha cause; But they also feel that a 100% open door policy would simply be too expensive - they've put the cost at £1.4bn.
But even in these straitened times, the issue has taken hold among Labour MPs, and the Liberal Democrats can feel justifiably pleased that their long game has truly paid off.
Even David Cameron went out of his way twice on Wednesday to pay tribute to Nick Clegg for raising the subject, almost unheard of in the world of opposition politics.
So what now.
Well, some deal will be done and the government most likely will have to move.
But the real worry for Gordon Brown and his whips is that this could merely be the warm-up act for Thursday's vote on expenses.
Lose that and we're into some very dangerous territory for the prime minister, something the whips know all too well warning - as they are - that it's tantamount to a vote of confidence.