President Luis Guillermo Solis declared three days of mourning. Some 5,500 residents had to be evacuated.
Several towns were covered by water and mud, and small bridges collapsed.
Otto, the southernmost hurricane on record to hit Central America, made landfall in southern Nicaragua as a category-two storm on Thursday.
But it weakened rapidly and became a tropical storm as it moved into the Pacific, the US National Hurricane Center (NHC) said. At its peak, Otto had wind speeds of up to 175km/h (110mph).
Costa Rica had not been directly hit by a hurricane since records began in 1851.
The deaths were reported in the area of Bagaces and Upala, south of the border with Nicaragua.
Businessman Carlos Alberto Volio, 68, told Reuters news agency: "Otto leaves us in a very difficult situation, both for the country and for all of us. The recovery is going to be very hard."
There were no reports of casualties in Nicaragua and damage was said to be limited.
Officials in both countries had evacuated areas most at risk, closed schools and mobilised emergency crews.
Four people died in Panama earlier this week as a result of severe weather caused by Otto's approach.
Soon after Otto's landfall on Thursday, a powerful earthquake shook Nicaragua and El Salvador, briefly triggering a tsunami alert.
The 7.0-magnitude quake in the Pacific Ocean was about 120km (75 miles) off the coast of El Salvador.
There were no reports of damage or casualties related to the tremor, but media in Nicaragua said one woman died of a heart attack after hearing the tsunami warning.