Djibouti is seen as a key strategic location in the Horn of Africa, with United States, France and Japan already having facilities in the country.
"The negotiations have come to an end and the naval base will be built in Djibouti," Mahamoud Ali Youssouf told AFP on the sidelines of a summit of African leaders in Johannesburg.
"The goal of the base is to fight against pirates... and most of all to secure the Chinese ships using this very important strait that is important to all the countries in the world."
"For Djibouti, it's an additional strategic ally."
A former French colony, Djibouti guards the entrance to the Red Sea and, ultimately, the Suez Canal, and has been used by international navies as a hub in the fight against piracy from neighbouring Somalia.
"For a few years with the instability in Somalia, this region has become a refuge for pirates and the terrorist movements," Youssouf said.
In May, Djibouti's President Ismail Omar Guelleh told AFP that talks over the military base were underway.
Guelleh met with Chinese President Xi Jinping at the summit in Johannesburg, where China announced $60 billion of assistance and loans for Africa.