MP Mike Hancock has made a public apology over "inappropriate and unprofessional friendship" with a constituent.
Civil action against Mr Hancock alleging he sexually assaulted a female constituent was dropped earlier this month.
A statement said both parties had agreed a confidential settlement.
Mr Hancock, who remains an in-patient at the Priory Hospital, released the statement as part of the agreement.
A psychiatric report was obtained confirming Mr Hancock had full capacity to make the statement.
In the 400-word apology he said: "In October 2009 you first came to me as a constituent to seek my assistance as your MP and councillor.
"Subsequently and over several months I came to your home on several occasions, sometimes unannounced, and conducted a friendship with you that was inappropriate and unprofessional.
"I understand that you felt degraded. I did not treat you with sufficient respect.
"I made you feel deeply uncomfortable and discriminated against and I crossed the line."
The MP for Portsmouth South had denied claims of sexual harassment, but was suspended from the Lib Dems after being found guilty of breaching standards codes.
Mr Hancock, who has been an MP since 1984, was arrested in 2010 after a complaint was made about his behaviour towards a vulnerable constituent who had a history of mental health problems.
Hampshire Constabulary decided not to press charges following an investigation.
The chairman of Portsmouth Liberal Democrats, Simon Dodd, said Mr Hancock would now be subject to an internal disciplinary hearing.
He said: "After today's developments and the admissions he has made, we are incredibly disappointed that Mike Hancock has chosen not to proceed with the court case in order to clear his name.
"Mike Hancock has admitted behaving in an unprofessional way that caused harm and distress to a constituent and we are very disappointed that his apology was not made at a much earlier stage."
The constituent at the centre of the complaint, who cannot be named for legal reasons, also released a statement, which said her physical and mental health had suffered since making the complaint against Mr Hancock in 2010.
She said: "I have only ever sought justice and an apology from Mr Hancock and that is what my legal team have fought to obtain throughout.
"Whilst there were further allegations made in the case, as part of the compromise reached and in recognition of the very extensive apology made by Mr Hancock, I will not now pursue these allegations further."