The 48-year-old, who was elected during the 2019 general election, had already been thrown out of the Conservative Party after being found guilty of the offence earlier this week.
A spokesman for the Tories said Khan had been expelled “with immediate effect” following the decision at Southwark Crown Court on Monday.
Jurors decided Khan was guilty after hearing how he forced the teenager to drink gin and tonic, dragged him upstairs and asked him to watch pornography before the attack at a house in Staffordshire in January 2008.
The victim made a complaint to police days after Khan helped Prime Minister Boris Johnson win a large Commons majority by taking Wakefield in the so-called “red wall” that had formed Labour’s heartlands in the Midlands and northern England.
Khan had been suspended by the Tories pending the result of the trial, with the decision to expel him taken after confirmation of the jury’s ruling.
In a resignation statement posted to Twitter on Thursday, Khan said: “While legal proceedings are ongoing, I do not believe that it would ordinarily be appropriate to resign.
“However, owing to long delays in the legal process, my constituents have already been without visible parliamentary representation for a year. Even in the best case scenario, anticipated legal proceedings could last many more months.
“I have therefore regrettably come to the conclusion that it is intolerable for constituents to go years without an MP who can amplify their voices in Parliament.
“Representing them has been the honour of my life, and they deserve better than this.
“Consequently I am resigning as MP for Wakefield and withdrawing from political life.”
He said he would write to the parliamentary authorities to confirm his intentions “shortly”.
“I am now able to focus entirely on clearing my name. As I intend for this to be my only statement, I would like to apologise to my family and community for the humiliation this has caused them,” he said.
Khan, who is gay and Muslim, added: “Questions surrounding sexuality in my community are not trivial, and learning from the press about my orientation, drinking and past behaviour before I became an MP has not been easy.”