Tens of thousands of revelers dressed in black and white crowded into downtown Rio on Saturday, dancing with the traditional Black Ball band and hoping carnival will allow them to set aside the violence casting a shadow over the city in recent weeks.

Rio Mayor Cesar Maia kicked off the celebrations Friday, handing over the key to the city to the carnival king or Rei Momo in a ceremony outside city hall and declaring that "from this moment, happiness will reign across the city."

But the celebration was overshadowed by rising crime, including drug gang battles and last week's dragging death of 6-year-old Joao Helio Fernandes.

"Rio has to overcome these regrettable facts and affirm its nature and the identity of a cohesive, tranquil, peaceful and happy people. carnival is a good moment to face these facts and say 'no' to them," Maia said.

The killing of Fernandes, who was dragged for four miles on the side of a car after it was stolen, shocked a city somewhat inured to violence. Rio is one of the world's most violent cities, with a homicide rate of around 50 per 100,000.

On Friday night, several "blocos," as the street carnival groups are known, paid homage to Fernandes by distributing white flowers in his memory.

The city also has faced a wave of violence stemming from battles between drug gangs and paramilitary militias made up of active and off-duty police, firefighters and soldiers who in recent weeks have been waging bloody battles for control of the city's shantytowns.

Although the federal government has sent in special troops to quell the violence, at least 15 people have been killed in shootouts over the past week.

Earlier this week, the vice president of premiere samba group Salgueiro was shot dead alongside his wife in hail of gunfire. Police still are determining the motive.

But many in Rio appeared ready to celebrate.

"The question of violence is notorious," said Alex de Oliveira Silva, the city's carnival king for the ninth year running. "It requires some serious work, but during carnival we have the right to play, and I hope people filled with the spirit of carnival can enjoy the permeability between social classes and respect each other."

Tens of thousands headed to the hilltop neighborhood of Santa Teresa to celebrate with the irreverent carnival group Carmelitas, whose members dress up as nuns. Other fell in behind impromptu blocos around the city tying up traffic.

Tourists on Copacabana beach said they did not feel afraid and were eager to participate in the annual pre-Lenten bash.

"I've heard the criminal rate is very high here, but I've been around Latin America and this city doesn't seem any more or less dangerous," said Adam Andrew, a 27-year-old project manager as he sipped a beer with a friend. "I'm excited."

The high point of Rio's celebrations are the samba parades on Sunday and Monday nights when 13 of the city's top-tier carnival groups will parade through the specially designed "Sambadromo" stadium, which holds 60,000.

Tourism authorities expect nearly 700,000 tourists to attend this year's festivities, about 30 percent of them from abroad.

Police have deployed some 30,000 officers around the city, including about 5,000 around the Sambadromo.

Carnival celebrations also were taking place in other cities across Brazil, such as Salvador and Olinda on the country's northeastern coast where festivities got under way Thursday.