Boris Johnson joined veterans, bereaved family members and senior defence figures at a service at Staffordshire's National Memorial Arboretum.
Mr Johnson praised the "incredible daring and bravery" of Falklands veterans.
Some 255 British troops, 649 Argentine military personnel and three Falkland islanders died during the conflict.
The 10-week war began in April 1982, when troops from Argentina invaded the Falkland Islands, a British colony in the south Atlantic ocean.
Argentina said it had inherited the islands from Spain in the 1800s and wanted to reclaim them. The British had ruled the islands for 150 years and sent armed forces by sea to take the islands back. Argentina's troops surrendered on 14 June.
On Tuesday, veterans, civilians and bereaved family members attended a service hosted by the Royal British Legion at the National Memorial Arboretum in Alrewas to remember the end of the conflict. At the same time a service was held at Port Stanley, the Falklands capital.
Mr Johnson - who laid a wreath at the service - told journalists afterwards: "The first thing is to remember what an incredible thing it was that they achieved back in 1982 to make an opposed landing, to take back territory in the way that they did.
"The incredible daring and bravery of those young men and women. And we salute that - we remember that today."
He added that the "greatest tribute" to those who had laid down their lives was that the Falklands Islands had since "thrived in peace and freedom".
By Ollie Peart
The city of Stanley on the Falkland Islands struck a sombre tone on Tuesday's morning under a grey winter drizzle.
Hundreds turned out to watch the band parade along the harbour front to the city's monument, where islanders paid their respects and to those who lost their lives in the conflict 40 years ago.
Soon after the memorial was over, the mood changed to celebration.
This is a defiant nation and one that wants the world to know it takes its freedom seriously, not taking a moment of it for granted.
The festivities will continue long into the night, a momentary breath of fresh air away from the dark cloud that continues to hang over these islands 40 years on, that of Argentina.
Events have also been taking elsewhere in the country, including at Portsmouth and Southampton, where ships departed for the islands, as well wreath-laying services in Dorset.
One survivor of HMS Coventry, which was bombed during the war, shared his memories with the BBC, saying: "I think about it nearly every day and you know it is part of my life and it is part of this nation's heritage."
"I remember my lost friends every year and sadly there is additions because we are all getting older," said Mick Kerry, from Warwickshire, who was a 21-year-old marine engineer on the Royal Navy destroyer when it was bombed.
Elsewhere, a woman who was born in the Falkland Islands three months before the war has been telling the BBC how she became a soldier to repay a debt of gratitude she felt towards the soldiers who fought in the conflict.
Sara Halford, who joined the British Army aged 17 and serves with 16 Medical Regiment in Colchester, said islanders would be "forever grateful".
Meanwhile, a collection of portraits of seven veterans from across Scotland have been revealed as part of a virtual exhibition by Glasgow photographer Wattie Cheung.
On Saturday, a national remembrance parade and service will be held in Edinburgh, where hundreds of current and former servicemen and women are expected to take part.
On Sunday, members of the Tumbledown Veterans and Families Association marched to the cenotaph on Blackpool promenade. Nine men died at the Battle of Mount Tumbledown, overlooking Port Stanley, in the final days of the conflict.