According to the Acts of the Apostles, Sebastian
was a brave Roman soldier, captain of the Praetorian under Diocletian (280). A fervent Christian, assisted the martyrs in prison, and for this reason was put to death by Diocletian. He was executed by archers in the Christian iconography is depicted pierced by numerous arrows. Legend has it that the Roman matron Luciana found his body in a sewer right where the church now stands. In the fourth century a small church was built on the site dedicated to San Sebastiano, which became a place of frequent pilgrimages.
Next to the church was the palace of the Sienese Piccolomini family, which in 1582 was given to the Theatine Fathers
by the Donna Costanza Piccolomini d'Aragona, duchess of Amalfi and descendant of the family of Pope Pius II. They were asked to build a church dedicated to St Andrew, patron of Amalfi. The Theatines moved to San Silvestro al Qurinale a few years later, when Sixtus V had the road widened and demolished the church and palace - but a church dedicated to St Andrew was still built, and still controlled by the Theatines. It is named "della Valle" because it was built near the valley which was there formed by the Euripus of Agrippa.
The church was designed by Pier Paolo Olivieri in 1590 or 1591. Francesco Grimaldi continued the work, and it was completed by Carlo Maderno
in 1608-1621 at the expense of Cardinal Alessandro Peretti-Montalto, grand-nephew of Pope Sixtus V. The fine fašade was completed by Carlo Rainaldi
in 1665, slightly altering Carlo Maderno's original design, at the expense of Cardinal Francesco Peretti, nephew of Cardinal Alessandro.
In the late 19th century Father Francesco di Paola Ragonesi, general of the order, restored the church to its former splendour, aided by the munificence of Filippo Giove Romano.
The first act of Puccini's opera Tosca is set in this church (in the Barberini Chapel).