Gordon Brown has contacted Kenya's President Mwai Kibaki and opposition leader Raila Odinga to express his concern about violence in the country.
There have been running battles and looting in Nairobi slums
The prime minister urged both to work for "unity and reconciliation" after at least 100 people died in clashes over a disputed presidential election.
Foreign Secretary David Miliband said he was "appalled" by the violence.
The Foreign Office has advised against all but essential travel to parts of Kenya, including Nairobi city centre.
About 7,000 Britons are currently in Kenya, most of them on holiday.
Mr Kibaki was officially re-elected president in the election, but Mr Odinga says he was robbed of victory by voting fraud.
A statement from Downing Street said the prime minister had spoken to both men by telephone on Monday.
"With both he expressed the UK's concerns about the conduct of the Kenyan elections, but strongly urged both to work for unity and reconciliation.
"All sides should exercise and work for a solution that reflects the will of the Kenyan people."
In a joint statement with International Development Secretary Douglas Alexander, Mr Miliband said he condemned the violence.
"We call on those involved, including government security forces and political party supporters, to behave responsibly, to act within the law, and to address their grievances peacefully," they said.
They added that they had serious concerns over the elections and vote counting, and urged Kenya's political leaders to "enter a process of dialogue".
Britons in Kenya, and Kenyan expats who have family back home, have been describing the violence.
A British teacher told how she and her family, including her newborn baby, were forced from their home in Kisumu, an opposition stronghold and scene of some of the worst violence.
Alison Rogers, 42, also said the school she ran with her husband had been burned down and there seemed to be no way out of town.
"This morning we had a lot of people at the gate trying to break the gate down to the house.
"We phoned the police. The police brought tear gas down and helped us to get to a hotel where I am with my family at the moment.
"It's very, very terrifying," she said.
Kenyan Meera Shah, who is studying in London, said she was "terrified to the bone" for her family, who are also in Kisumu.
Ms Shah, 22, who came to London in October 2004, said: "Like me, there are thousands of Kenyans living and studying abroad.
"We are absolutely terrified to the bone because we don't know what's going to happen in the country."
She said she had been in constant touch with her family, who all live in what she described as the normally "peaceful" town.
Text messages she had received from family and friends included the following, sent on Monday: "Town is completely finished. There is a shoot-on-sight order. It's like Iraq.
There has been widespread looting and property damage in Kenya
"People have no idea what to do. Town has burnt down entirely and there are no more shops to loot."
The Foreign Office has urged Britons in Kenya to "stay indoors and seek advice locally" before travelling around the country.
As well as Nairobi city centre, it has warned against all but essential travel to some districts in Mombasa.
A spokeswoman said: "We constantly review our travel advice for individual countries and will be looking at the Kenya situation closely."
Kenya receives about 290,000 visitors each year, many in January and February.
Many of the thousands of British tourists there are on safari or staying in beach resorts close to Mombasa, where there have also been violent clashes.
One British tourist, who asked not to be named, is staying in the capital, Nairobi, and is unable to continue her journey on to Mombasa because of the dangers.
She said: "Petrol is in short supply, in some places non-existent.
"Food is the same. Farmers who sell produce here in Nairobi markets for the average family cannot get here, so fresh food is not available.
"No money is available as ATMs are empty. Most hotels have placed a 'polite' notice saying they are short-staffed. Some staff are having to stay in hotels sleeping on floors."
Holiday company Kuoni said it had scrapped local excursions from Mombasa and Nairobi.
However, British tourist Ivan Newman is at a beach resort south of Mombasa with his family, and described the holidaymakers there as "pretty relaxed".
He said: "There's a news blackout here, the government seems to have stopped the newspapers, there's not much happening on the radio either.
"We're getting a lot of our information from the people here, mainly through texts, that they're receiving from their family and friends elsewhere in Kenya.
"We're in a very resorty sort of place here, it looks as though most of the violence is limited to the urban areas."