Witnesses told IRIN the explosions were caused by suicide bombers in cars.
In Hargeisa, a local journalist said the attackers "were definitely suicide bombers, who seem to have coordinated their attacks".
Police sources told IRIN five men have arrested in connection with the attacks on Hargeisa.
Somaliland President Dahir Riyaale told a news conference in Hargeisa on 29 October that 19 people were killed in three suicide attacks.
However, a local journalist told IRIN that 39 people were killed and over 50 injured, including four journalists.
A statement from the Office of the UN Resident and Humanitarian Coordinator for Somalia said: "At approximately 10 o'clock this morning the UNDP [UN Development Programme] compound in Hargeisa, Somaliland, was hit by an explosion, caused by a vehicle which forced entry into the compound."
The statement added there were casualties, "but the numbers are currently being verified".
Witnesses said the bombs also went off at the presidential palace and the Ethiopian embassy in Hargeisa.
"I was sitting in a café in front of the presidential palace when I was hit by something on my head; when I touched it I found I was bleeding, and I was taken to the hospital," said Jamal Abdi, a local journalist.
Hundreds of people are crowding around Hargeisa general hospital to check on family and friends. "It is so crowded that police are firing into the air to disperse people," said the journalist.
Muse Gelle, governor of Bari Region, where Bossaso in located, told IRIN that four people, including the two suicide bombers, were killed in the Bossaso attacks.
He said seven security officers were being treated in hospital. He added that the target was the Puntland Intelligence Service (PIS) compound.
Gelle said the security compounds were "seriously damaged by explosions".
The governor said no one had claimed responsibility for the attacks.
"We cannot say who is behind this now but the police are investigating it and will issue a statement once we have identified the culprits," he said.