President Vaira Vike-Freiberga also spoke, urging people to pray for Latvia's safety against enemies that would like to "destroy, defame and defile it."
She said people should call on God "to give strength to those who sincerely and honestly want to serve their country and to people who would pass this land onto their children and grandchildren as a sacred inheritance."
After the service the Latvian president, as well as Prime Minister Andris Berzins, Parliament Speaker Janis Straume, ministers and lawmakers laid flowers at the landmark Freedom Monument in Riga.
Later the Parliament held a session dedicated to Independence Day, and around 1,000 troops from the Latvian National Armed Forces marched in a parade watched by a crowd of several thousand people.
The celebrations culminated with an address to the nation by the popular president, which was broadcast live on national television.
Thousands gathered at the Freedom Monument to listen in person to the speech, in which Vike-Freiberga called on people to work for the benefit of the state, likening this to tending a garden.
"You have to weed it, loosen the soil, water it, and work, and it is no quick effort - you have to do it all summer. You have to work. Whatever you want to achieve, you have to work," she said.
Latvia's independence is worth celebrating, even though not everything in the state is perfect, she said.
"Yes, we still have a lot of weeds in our fields. Yes, our fields are overgrown with bushes and poisonous plants. Yes, our community still has many scars and aches and deficiencies," the president went on.
Latvia has to fight "corruption, crime, laziness, sloppiness, irresponsibility and cruelty to others."
"These are flowers of doom," she said, which may or may not have been a reference to the incident in which a protester against the current campaign in Afghanistan struck Britain's Prince Charles on the face with a carnation when he recently visited Riga.
"They will always remain among us, but we will fight them because this is our country, our freedom, our chance to build something with our own hands, in the way we see it and in the way we feel it in our hearts."
Concluding her speech Vike-Freiberga called on people to celebrate independence and - returning to work on Monday (Nov. 19) - to dream about a Latvia "ideal, noble and beautiful."
Fireworks then lit up the dark skies above Riga.