He said he was stepping down from the party temporarily, after a meeting with the party's chief whip on Monday,
The Portsmouth South MP is being sued in a High Court civil action by a female constituent who had contacted him for help in a neighbour dispute.
Mr Hancock said he "completely refuted" the claims and was "vigorously" defending himself.
Party leader Nick Clegg said last week he had spoken to chief whip Alistair Carmichael about the possibility of suspending the MP from the party, but at the meeting on Monday in Westminster Mr Hancock instead offered to temporarily withdraw until the court case is concluded.
In a letter to Mr Carmichael, he said: "I can assure you that I will continue to vigorously defend my position and that I completely refute the allegations against me.
"I'm doing this in the best interests of the party nationally and in Portsmouth and for my family.
"I will continue to work hard for my constituents in Portsmouth as I have always done."
In his reply, the chief whip said: "These are very serious allegations and the party takes them very seriously.
"I realise that you have denied them consistently and continue to do so.
"If, at the end of your case, your name is cleared then I would fully expect to have you back in the parliamentary party to play again your role in the Commons."
Mr Hancock, who has been an MP since 1997 and also sits on Portsmouth City Council, was arrested on suspicion of indecent assault in 2010 but never charged.
He was accused of "inappropriate behaviour", which he denied, towards a female constituent following a series of visits he made to her home.
It was alleged he placed his hand on her breast, exposed himself and kissed her without consent.
Mr Hancock hit the headlines in 2011 when he had an affair with his aide, Katia Zatuliveter, who was accused of being a Russian spy.
But the Special Immigration Appeals Commission said it had seen nothing to support the allegations against Miss Zatuliveter and she won an appeal against deportation.
Liberal Democrat MP Mike Hancock has resigned the party whip while he contests allegations of sexual assault.