The human rights lawyer beat rivals Rebecca Long-Bailey and Lisa Nandy after the first round of voting.
It marks a significant change of direction for the party, with a move away from the politics of Mr Corbyn.
His victory came after the planned special conference to unveil the winner had to be shelved because of the coronavirus crisis.
Angela Rayner won the deputy leadership race.
Sir Keir said: “It is the honour and the privilege of my life to be elected as leader of the Labour Party. It comes at a moment like none other in our lifetime.
“Coronavirus has brought normal life to a halt. Our cities, our towns and our villages are silent, our roads deserted. Public life has all but come to a standstill and we're missing each other.
“People are frightened by the strangeness, anxious about what will happen next. And we have to remember that every number is a family shaken to its foundation.
“Unable even to carry out the most poignant of ceremonies, a funeral, in the way that they would like. It reminds us of how precious life is, but also how fragile.
“It reminds us of what really matters, our family, our friends, our relationships. The love we have for one another. Our health.
“Our connections with those that we don't know. A greeting from a stranger, a kind word from a neighbour. These make up society. They remind us that we share our lives together. We have to trust one another and look after one another.
“And I can see this happening, people coming together to help the isolated and the vulnerable, checking on their neighbours.
“So many volunteering for the NHS, millions of people doing their bit to stop this virus and to save lives.
“Our willingness to come together like this as a nation has been lying dormant for too long. When millions of us stepped out onto our doorsteps to applaud the carers visibly moved there was hope of a better future. In times like this, we need good government, a government that saves lives and protects our country.
“It's a huge responsibility and whether we voted for this Government or not, we all rely on it to get this right. That's why in the national interest the Labour Party will play its full part.
“Under my leadership we will engage constructively with the Government, not opposition for opposition's sake. Not scoring party political points or making impossible demands. But with the courage to support where that's the right thing to do.
“But we will test the arguments that are put forward. We will shine a torch on critical issues and where we see mistakes or faltering government or things not happening as quickly as they should we’ll challenge that and call that out.
“Our purpose when we do that is the same as the Government's, to save lives and to protect our country, a shared purpose.
“But that is not the only task for the Labour Party. The weeks ahead are going to be really difficult. I fear there are going to be some awful moments for many of us.
“But we will get through this. The curve will flatten, the wards will empty, the immediate threat will subside. And we have scientists working on vaccines.
“But when we do get through this we cannot go back to business as usual. This virus has exposed the fragility of our society. It's lifted a curtain.
“Too many will have given too much. Some of us will have lost too much. We know in our hearts, things are going to have to change.
“We can see so clearly now who the key workers really are.
“When we get through this it'll be because of our NHS staff, our care workers, our ambulance drivers, our emergency services, our cleaners, our porters.
“It will be because of the hard work and bravery of every key worker as they took on this virus and kept our country going.
“For too long they've been taken for granted and poorly paid. They were last and now they should be first.
“In their courage and their sacrifice and their bravery, we can see a better future. This crisis has brought out the resilience and human spirit in all of us.
“We must go forward with a vision of a better society built on that resilience and built on that human spirit. That will require bravery and change in our party as well.
“I want to thank Rebecca and Lisa for running such passionate and powerful campaigns and for their friendship and support along the way.
“I want to thank our Labour Party staff who worked really hard and my own amazing campaign team, full of positivity, with that unifying spirit.
“I want to pay tribute to Jeremy Corbyn, who led our party through some really difficult times, who energised our movement and who's a friend as well as a colleague.
“And to all of our members, supporters and affiliates I say this: whether you voted for me or not I will represent you, I will listen to you and I will bring our party together.
“But we have to face the future with honesty.
“Antisemitism has been a stain on our party. I have seen the grief that it's brought to so many Jewish communities.
“On behalf of the Labour Party, I am sorry.
“And I will tear out this poison by its roots and judge success by the return of Jewish members and those who felt that they could no longer support us.
“The Labour Party is an incredible and powerful force for good.
“Together with those that went before us we've changed the lives of millions of people for the better.
“We created the NHS. We created the welfare state. We passed equalities legislation, the Race Relations Act, we set up the Open University. We built hospitals and schools, established Sure Start and played our part in bringing about peace in Northern Ireland.
“But we've just lost four elections in a row. We’re failing in our historic purpose.
“Be in no doubt I understand the scale of the task, the gravity of the position that we're in.
“We've got a mountain to climb.
“But we will climb it, and I will do my utmost to reconnect us across the country, to re-engage with our communities and voters, to establish a coalition across our towns and our cities and our regions with all creeds and communities to speak for the whole of the country.
“Where that requires change, we will change. Where that requires us to rethink, we will rethink.
“Our mission has to be to restore trust in our party as a force for good and a force for change.
“This is my pledge to the British people. I will do my utmost to guide us through these difficult times, to serve all of our communities and to strive for the good of our country.
“I will lead this great party into a new era, with confidence and with hope.
“So that when the time comes, we can serve our country again in government.”
Ms Rayner said: “I want to thank everyone who took part in this election, and all those who have supported me through the campaign. I promise that I will do everything I can to repay your trust.
“Things have dramatically changed in our country in recent months but our values remain the same, and more important than ever.
“Those are the values we will reflect in our actions as an opposition and a movement – standing up for our public services, for our workers and carers, and for a society in which people work together and look after one another.
“Together, we must rebuild and reconnect with communities right across Britain who need our support now, more than ever before.
“I know we face a long and difficult road ahead but we must unite, both in the face of this crisis and to offer the better future that the citizens of our country deserve.
“I also want to offer my congratulations to Keir. This was a long campaign and by the end one conducted in extraordinary circumstances. The hard work begins today, and Keir will have my full support in both getting Labour on the path back to government and in being a voice for those who need us during this national crisis.
“We must make sure the government delivers on its promises, and acts faster to provide the protection frontline workers need.”