Leaders of the major industrial nations have pledged one billion Covid vaccine doses to poor countries as a "big step towards vaccinating the world", Boris Johnson has said.
At the end of the G7 summit in Cornwall, the PM said countries were rejecting "nationalistic approaches".
He said vaccinating the world would show the benefits of the G7's democratic values.
There was also a pledge to wipe out their contribution to climate change.
After the first meeting of world leaders in two years, Mr Johnson said "the world was looking to us to reject some of the selfish, nationalistic approaches that marred the initial global response to the pandemic and to channel all our diplomatic, economic and scientific might to defeating Covid for good".
He said the G7 leaders had pledged to supply the vaccines to poor countries - including 100 million from the UK - either directly or through the Covax scheme, which is being co-led by the World Health Organization, Gavi and the Coalition for Epidemic Preparedness Innovations.
The communique issued by the summit pledges to "end the pandemic and prepare for the future by driving an intensified international effort, starting immediately, to vaccinate the world by getting as many safe vaccines to as many people as possible as fast as possible".
It also includes steps to tackle climate change, with leaders re-committing to the target of reaching net zero greenhouse gas emissions by 2050 at the latest and pledging to eliminate most coal power.
Mr Johnson rejected suggestions the vaccines pledge was a moral failure by the G7 as it was not enough to cover the needs of poorer countries.
He referred to the the UK's involvement in the development of the Oxford-AstraZeneca vaccine.
"Already of the 1.5 billion vaccines that have been distributed around the world, I think that people in this country should be very proud that half a billion of them are as a result of the actions taken by the UK government in doing that deal with the Oxford scientists and AstraZeneca to distribute it at cost," he said.
He added that "we are going flat out and we are producing vaccines as fast as we can, and distributing them as fast as we can".
The target to vaccinate the world by the end of next year would be met "very largely thanks to the efforts of the countries who have come here today", Mr Johnson said.
The leaders slightly exceeded their target of donating a billion Covid vaccines to poorer countries within the next year, if funding for future doses is included alongside individual jabs.
There was also a commitment to build the frameworks to prevent and fight future pandemics. Elsewhere in the 25-page communique, there were several references to China, which President Biden said was a change from previous meetings of the world's advanced economies.
Pledges made this time included working together to respond to China's impact on world trade.
On the recovery from Covid there was even a reference to Prime Minister Boris Johnson's trademark domestic policy - the need to reduce inequalities by "levelling up".
Charities and campaigners issued statements calling out vague promises and missed opportunities, but Mr Johnson will feel that post-Brexit Britain has staged a diplomatic show that was both competent and confident.
Mr Johnson also dismissed the suggestion that patents for vaccines should be waived in order to boost global supply, something which the US backed last month.
He said he wanted to protect "incentives for innovation" while building up manufacturing capacity, especially in Africa.
Elsewhere in their communique, G7 leaders also pledged to:
- improve early warning systems to prepare for future health crises
- phase out coal-fired power stations without carbon capture technology and raise $100bn (£70bn) to help poorer countries cut emissions
- support a green revolution that creates jobs, cuts emissions and seeks to limit the rise in global temperatures to 1.5 degrees
- reinvigorate their economies "with plans that create jobs, invest in infrastructure, drive innovation, support people, and level up so that no place or person, irrespective of age, ethnicity or gender is left behind"
- "build back better" by establishing a clean, green growth fund for infrastructure developments in developing countries
- respond to China's impact on world trade and challenge practices which "undermine the fair and transparent operation of the global economy"
- call on China to respect human rights, especially in relation to Xinjiang, where it has been accused of abuses against Uyghur Muslims
- get 40 million more girls into education by 2026
The communique calls for a "timely, transparent, expert-led, and science-based WHO-convened" investigation into the origins of Covid-19.
US President Joe Biden has previously said the US intelligence community is split on whether coronavirus came from human contact with an infected animal or from a lab accident - a theory rejected by China.
Mr Johnson said "the advice that we've had is it doesn't look as though this particular disease of zoonotic origin came from a lab", but he added: "Clearly anybody sensible would want to keep an open mind about that".
French President Emmanuel Macron said the international community needed clarity about the origins of the virus but said it was up to the WHO to investigate.
With G7 countries accounting for 20% of carbon emissions, Mr Johnson said: "We were clear this weekend that action needs to start with us."
But pressed on the lack of binding agreements and timetables, the prime minister says he will not "pretend our work is done" and he will be "on everybody's case" to make further progress ahead of the COP26 summit in Scotland later this year.
Kirsty McNeill from Crack the Crises, a coalition of charities and NGOs including Save the Children and Oxfam, said the G7 summit was a "historic missed opportunity" on Covid-19 and climate change.
Leaders arrived "with good intentions but without their cheque books", she said.
Joanna Rea, from Unicef UK, said the G7 pledge on vaccines was "the beginning of the action required to end this pandemic" but called for a "rapid acceleration of dose sharing in the next three months to ensure millions of vaccines get to the people in countries who need them the most".