They had targeted a restaurant known as The Village in the Hodan district of the city but were stopped by guards, one of whom was killed.
The attackers opened fire on the guards, a local resident told Reuters.
Suicide bombers attacked another restaurant belonging to the same owner in September, killing 14 people.
Such attacks are fairly common in the city, as are targeted assassinations, BBC Africa analyst Mary Harper reports.
Some are carried out by the Islamist group al-Shabab, which controls much of the country. Others by different groups including private militias and criminal gangs.
Two suicide bombers have blown themselves up trying to enter a restaurant in the Somali capital Mogadishu, killing at least one person.