He was in his hotel room in London, where he is due to perform at the Lyric Theatre, when officers barged in.
Tweeting about his predicament he said hotel staff mistook him for a guest who had threatened staff with a knife.
He was handcuffed and led from the room shouting "but I'm in my kegs". Met Police said he was mistakenly detained.
Geordie comic Ramsey is touring the country with his show All Growed Up and provided a running commentary on Twitter of Sunday night's events.
"Well... The police have definitely just kicked my hotel door in and handcuffed me," the first tweet, sent at 00:47, said.
In a string of follow-up tweets he said: "Hotel staff ID'd me as someone who had been in the hotel earlier threatening staff with a knife. So when I checked in just now they called the police and sent them up to my room! I kept asking 'is this a joke?' When he said 'no come with us' police put the handcuffs on me and began to march me out of the room when I shouted 'but I'm in my kegs'.
"I love the idea that someone who was in earlier threatening staff with a knife, would then check in later for a kip!!", he tweeted.
On his way to breakfast he said he was taking precautions by wearing an anonymous black cap and black T-shirt, lest he be mistaken for "a murderer or something".
Ramsey - who is a panel show regular and has also starred in BBC sitcom Hebburn - tweeted that his ordeal might be discussed during his stand-up routine later.
A Met Police spokesman confirmed officers had initially been called to deal with a man who was threatening hotel staff with a knife in a racially aggravated attack.
Officers returned to the hotel after midnight when they mistakenly arrested and subsequently released Ramsey, the spokesman said.
Comedian Chris Ramsey was arrested at midnight in his underpants - but has since said he sees the funny side of the case of mistaken identity.