Founded by the Romans and named Oliastrum, Azambuja was occupied by the Moors, who called it "Azzabuja", the origin of its present name. In the 12th century, King Dom Sancho I, aided by the Knights of Flanders, drove the Arabs out of this region and donated these lands to one of the Flemish nobles as a reward for the assistance given in the Reconquest.
Its 13th century Charter was confirmed by King Dom Manuel I in the 16th century, a period when Azambuja underwent major expansion. The Igreja Matriz (Parish Church) and the Igreja da Misericórdia (Church of Mercy) date back to this period. Later, in the 18th century, the building began of the Palace of Obras Novas, which was used as an inn and as a station for the steam trains from Lisbon to Constância.
Azambuja is nowadays a rapidly-expanding town, benefiting from an excellent location next to the motorway and the northern railway (which has a modern station here).