The undeclared war lasted for 10 weeks from April 2 until June 14 1982, after Argentina invaded the occupied islands.
It claimed the lives of 255 British servicemen who were remembered as part of the commemorations in Edinburgh on Saturday.
Veterans who served in the Falklands gathered at Charlotte Square, joined by the band of Her Majesty’s Royal Marines and the Scots Guards Association Pipes and Drums.
They marched along George Street which culminated in a memorial service in St Andrew’s Square as members of the public lined the streets.
Pipers played “The Crags of Tumbledown Mountain” and were simultaneously joined by 120 pipers from elsewhere in Scotland and from as far away as New Zealand.
Joining them was Justice and veterans secretary Keith Brown, who gave a reading and laid a wreath in remembrance.
Mr Brown was a mortar troop signaller in the Royal Marines and was sent to the Falklands in 1982.
He said he does not “talk much about it” unless he is meeting up with others who served.
“I suppose it tends to be a kind of shorthand – if somebody else was there, they know certain things, you don’t have to go over them,” he said.
He joined the armed forces after he lost his job.
Mr Brown added: “I had lost a job and I wanted to get fit, so I thought I’d try the armed forces. The first recruitment office I went into was on Lothian Road, in Edinburgh, which was a Navy recruitment office. There was no big family tradition, it was just something that I did at the time.
“I am delighted that we have been able to partner with Legion Scotland and Poppyscotland to deliver a commemoration which will provide the people of Scotland with an opportunity to recognise the sacrifices made 40 years ago in the Falklands War.”
The justice secretary was also joined by a fellow veteran, the Rev Angus Smith, who served in the Falklands as Padre to the 2nd Battalion Scots Guards.
“It’s wonderful that we can still share our grief in this way,” Mr Smith said. “It’s still there and I suppose it is for everybody.
“It has been one of the most wonderful experiences I’ve had in years. The thought that has gone into this, it’s beautiful really. The first person I met today was the wife of a great friend of mine, who was amongst the first men killed in the war. We just looked at one another today, and we couldn’t speak.”
The event was organised by Poppyscotland and Legion Scotland.
Dr Claire Armstrong, chief executive of Legion Scotland, said: “It was heartening to see so many people come together today to pay tribute to all those who served in the Falklands.
“For veterans and their families, today was a very poignant day, as we remembered those who laid down their lives 40 years ago. Even now, many of those who served are still living with the physical and mental scars of the conflict.
“This was also an opportunity to recognise the extraordinary resilience of our armed forces community and the vital role they continue to play today.
“We’re delighted that people of all ages have engaged with our learning programme over recent months, taking the chance to find out more about the Falklands and other conflicts, and their impact on our recent history.
“It was particularly moving to hear the iconic pipe tune ‘The Crags of Tumbledown Mountain’ being played at 11am, both here at St Andrews Square and by our global pipe band in all corners of the world.