The King and other royal guests arrived at the Riksdag by horse and carriage, accompanied by a brass band.
They were greeted by the newly elected Speaker in parliament, Urban Ahlin.
The royal family had previously attended a service by Archbishop Antje Jackelén in Stockholm Cathedral, where they were also joined by Sweden's newly elected MPs.
Sweden's elected politicians in the country's parliament, known as the Rikstag. Photo. TT
The King made a speech, commenting on the recent heatwave in Sweden.
He said that the country had enjoyed a "great summer", but offered his respects to those affected by floods in Malmö and a forest fire in Sala in central Sweden.
The King added that Sweden's good fortunes stood in contrast to months of war and violence elsewhere in the world, referring to "war, ethnic conflicts and humanitarian crises that seem difficult to limit and control".
"It is with sadness and pain that we see and follow human suffering. We are horrified by the killing and suffering of children and all others who are fleeing for their lives," he told parliament.
King Carl XVI Gustaf then reflected on Sweden's new and divided parliament.
He described the current political landscape as one "that may lack well-known landmarks," but added that Sweden was a "stable country with a democratic social order".
Parliament was declared open after his final comments, when he wished for "power and wisdom" for Sweden's politicians.
Crown Princess Victoria also attended the ceremony. Photo: TT
Social Democrat politician Stefan Löfven is set to take over as the country's next Prime Minister, but he must first be formally elected by Members of Parliament later this week.
He has formally agreed to create a coalition government with Sweden's Green Party, replacing the centre-right Alliance that has ruled Sweden for the past eight years.
Outgoing leader Fredrik Reinfeldt was present at the opening of parliament, one of his few public appearances since announcing he was stepping down from his roles as Prime Minister and head of the Moderate Party, which led Sweden's previous centre-right coalition government.
Former Prime Minister Fredrik Reinfeldt (centre) was among the MPs at the ceremony. Photo: TT