The new election, Rebelo de Sousa said, would be on March 10.
Rebelo de Sousa made his decision public during a national televised address after he met with the nation’s Council of State, an advisory body made up of former politicians and other veteran public figures of renown. That came after he had met with the leaders of the parties in parliament on Wednesday.
Costa, Rebelo de Sousa said, will stay on as the country's caretaker prime minister until the election.
Costa, a Socialist, has led Portugal since 2015 and won a landslide election just last year.
But he stepped down immediately after Portugal was rocked by a major police raid on Tuesday as part of a corruption investigation that included the arrest of his chief of staff along with four other people and one of his ministers being named as a suspect.
The investigative judge who ordered the raids and arrests alleged malfeasance, corruption of elected officials and influence peddling related to lithium mine concessions near Portugal’s northern border with Spain and plans for a green hydrogen plant and data centre in Sines on the south coast.