Serbia, which is almost fully dependent on Russian gas supplies, has long planned to purchase gas from Azerbaijan once an interconnector to Bulgaria's pipeline is completed.
Azerbaijan's ministry quoted Serbia's Minister of Mining and Energy Dubravka Djedovic Handanovic as saying that the Bulgaria-Serbia Interconnector is expected to be commissioned in the near future
Serbia consumes more than 3 billion cubic metres of gas per year.
"The signed contract outlines the delivery of 400 million cubic meters of gas next year, and we expect these volumes to increase further in the coming years," she said.
Serbia, which aims to join the European Union, has come under pressure recently from Western countries to align its foreign policy with the bloc and impose sanctions on Russia.
Azerbaijan is considered by Europe as an alternative source of energy imports amid a deep political fallout with Moscow over the conflict in Ukraine and sharp cuts in Russian gas purchases.