A representative of the Queen was first to lay a tribute during the service at Dryfesdale Cemetery in the town attended by the families of victims, politicians and local community groups.
Eleven people died in Lockerbie along with the 259 passengers and crew on board the New York-bound Pan Am Flight 103 when it came down on the night of 21 December 1988.
Jeff Browne, Moderator of the Presbytery of Annandale and Eskdale, led the service. He said: “Whether you have come from the local community or from afar, whether you come with no faith, little faith or belong to a community of faith, know that the Lockerbie community welcomes you in love and peace today and every day.”
Prayers were read and a series of silences held before wreaths were laid at the base of a memorial containing the names of all 270 victims of the tragedy.
The Queen’s representative, Lord Lieutenant for Dumfriesshire Fiona Armstrong, laid the first tribute as a piper player in the cemetery.
She was followed by Scotland’s Lord Advocate James Wolffe QC and Scottish Secretary David Mundell.
Pupils from local schools and Scouts and Guides groups and representatives of the emergency services laid flowers before the families of victims approached the memorial.
Rev Susan Brown, Moderator of the General Assembly of the Church of Scotland, spoke at the service after wreaths were laid.
She said: “Scars from 30 years ago remain – they leave a mark that can never be removed, but while they will not disappear altogether and while we would never want to forget the horrendous cost of that single hateful act, we realise all the more acutely the sweetness of life and the need for it to be lived to the full.”
Mr Mundell, who is from the town, said ahead of the service: “On this 30th anniversary of the bombing of Flight 103 over Lockerbie, my thoughts and prayers are with the family and friends of the 270 men, women and children who perished on that terrible night, and everyone else whose life has been touched by the event.
“Lockerbie lost its anonymity that night. We went from a quiet small town to a centre of global attention in a few seconds. That was the scale of the challenge local people have faced, aside from the horrors of the air disaster itself. It has not been easy, nor have we been able to achieve the closure we would have wanted, even after 30 years.
“However, throughout, the people in Lockerbie have retained their dignity and stoicism, and offered friendship and support to those who lost loved ones.”
The majority of those on board the jet were American citizens, including 35 students of Syracuse University in New York State.
A memorial will be held at the university, and around 500 people are expected to gather at Arlington National Cemetery in Virginia where a cairn made from Lockerbie stone stands in memory of those who died.
Pam Am Flight 103 was blown up by the detonation of an explosive stored in a suitcase in the plane hold.
Many believe the atrocity was committed in revenge for the downing of an Iran Air passenger flight by a US missile cruiser earlier in 1988.
The only person ever convicted of the bombing, former Libyan intelligence officer Abdelbaset al-Megrahi, died in 2012 after being released from Greenock jail on compassionate grounds.