"The agreement on Wednesday will allow for one, united military base on Abkhaz territory, for Russian land troops," Garri Kupalba, the separatist region's deputy defence minister, said.
Kupalba said the new base, which would link several points across Abkhazia and accommodate at least 3,000 soldiers, including units from Russia's FSB security services, would be built "sometime in the near future".
Medvedev, who sat alongside Bagapsh at the signing ceremony, lashed out at Mikheil Saakashvili, the Georgian president.
"I will not personally have any dealings with the current president of Georgia. For Russia, he is persona non grata," Medvedev said.
The agreement allows Russian forces "to defend the sovereignty and safety of the republic jointly with the armed forces of Abkhazia".
It will be in force for 49 years and determines the legal status of Russian personnel and base property, Russia's RIA-Novosti state news agency said.
Moscow has said 1,700 Russian troops are stationed in Abkhazia, but this does not include hundreds more border guards who answer to Russia's FSB security service rather than the military.
The European Union and Nato, the Western military alliance, have repeatedly expressed concern that a Moscow-led military build-up in Abkhazia threatens Georgia's territorial integrity.
It is also watched with unease by Western powers for its proximity to crucial energy routes which flow to the EU.
Georgia decried the new plans for a land base as illegal.
"Abkhazia and South Ossetia are Georgian territories, and the deployment of foreign troops on the territory of another country is called an occupation," said David Bakradze, the country's parliamentary speaker.
"Since the Russian aggression in 2008, Abkhazia and South Ossetia have become one big military base for Russia."
Maxim Gvindzia, Abkhazia's deputy foreign minister, said the troops for the new base are already stationed in the region.
"Since the Russian aggression in 2008, Abkhazia and South Ossetia have become one big military base for Russia"
David Bakradze, Georgia's parliamentary speaker
Tbilisi accuses Russia of effectively annexing Abkhazia and South Ossetia, which broke away from Georgia in bloody separatist wars in the early 1990s.
Since Moscow recognised them as independent, only Venezuela, Nicaragua and the tiny island state of Nauru have followed suit.
Bagapsh, who was re-elected in December in a vote officially ignored by the West, is criticised by some Abkhaz for handing too much influence to former Soviet master Russia, on which Abkhazia depends for passports, pensions and half its budget.
In April 2009, Russia formally took control over the de-facto borders of Abkhazia and South Ossetia, provoking condemnation from Western powers.
Moscow also plans to build a naval base in Ochamchire on Abkhazia's northern coast.