Cross-border firing from Armenian forces hit civilian housing units in Azerbaijan, the Azeri Defense Ministry said on Saturday.
The shelling started Friday night and continued to hit the districts of Tovuz, Tartar and Aghdam until Saturday morning, according to a statement.
No casualties were reported but some buildings were damaged.
The attack came as Azerbaijan celebrates the 100th anniversary of the liberation of Baku.
The Azeri army responded with retaliatory fire, the ministry said.
Azerbaijan and Armenia remain in dispute over the occupied Karabakh region. Karabakh broke away from Azerbaijan in 1991 with Armenian military support, and a peace process has yet to be implemented.
On Sept. 15, 1918, Baku was liberated by the Caucasian Islamic Army, comprised of Azerbaijani and Turkish soldiers.