The first church, which had the same dedication, was built under Pope Hadrian I
(772-795). It was not in the same spot, but closer to Castel Sant'Angelo.
Pope Alexander VI
Borgia (1492-1503) demolished an ancient Roman pyramid on the same site (the Meta Romuli
, believed in the Middle Ages to be Romulus's tomb, and portrayed on the bronze doors to St Peter's Basilica) for the construction of the first church. That church was then demolished during the pontificate of Pius IV
Medici (1559-1565) to clear the line of fire for the cannons of the Castel Sant' Angelo.
Designs by Giovanni Sallustio Peruzzi
(with contributions by Ottavio Mascherino
and Francesco Peparelli
) for a replacement church were in place by 1566, though the papal artillery officers insisted that its dome be as low as possible to avoid a recurrence of the previous problem. This meant that the new church's dome was built without a supporting drum. The church was completed in 1668.
For reference, a plan of the church is available here