The announcement came after a dramatic escalation in months of largely peaceful anti-government protests over a dire economic crisis on the Indian Ocean island of 22 million people.
There was no immediate word from the president himself.
Speaker Mahinda Yapa Abeywardena said in a video statement Rajapaksa had informed him that he would step down from his post.
"He will resign on 13 (July), Wednesday, to ensure a peaceful handover of power", Abeywardena said.
The news of the president's decision triggered an eruption of celebratory fireworks in parts of Colombo.
Prime Minister Ranil Wickremesinghe also said he is willing to resign to make way for an all-party government, his office said in a statement on Saturday evening.
It was not yet clear if this would quell popular anger.
Throughout the day, soldiers and police were unable to hold back a crowd of chanting protesters demanding Rajapaksa's resignation and blaming him for the country's worst economic crisis in seven decades.