Media playback is unsupported on your device Media caption Ms Sturgeon said the energy firm's "only job is to secure the lowest price for consumers"

The Scottish government is to set up a publicly-owned, not-for-profit energy company, Nicola Sturgeon has confirmed.

The SNP leader told the party's conference that the company will sell energy to customers at "as close to cost price as possible".

Ms Sturgeon said it would be set up by 2021, and would give people - particularly on low incomes - more choice of which supplier to use.

She also said the SNP will "always make the case for independence".

And while the Scottish government has delayed plans for a second independence referendum, Ms Sturgeon insisted that the SNP still had a mandate for a vote on the issue.

She described the "essence of independence" as being "in charge of the decisions that shape your destiny" and "being in the driving seat and not simply at the mercy of events".

The first minister declared: "We are the party of independence. The case for independence doesn't depend on Brexit. But Brexit does show us what can happen when we don't control our own future".

Among Ms Sturgeon's other announcements were:

A "truly transformational" doubling of spending on early-years childcare to £840m by 2020

A new scheme to provide free sanitary products in schools, colleges and universities from next August

All young people leaving care will be exempt from paying council tax

A £6m fund to help the tourist industry in Scotland's more remote areas

Confirmed the 1% public sector pay will be lifted in Scotland

Announced that permission has been granted to the people of Ulva, an island off the west coast of Mull, to bring their island into community ownership

Media playback is unsupported on your device Media caption Nicola Sturgeon: "The gap between Scotland's interests and Westminster's priorities has never been wider."

The possibility of launching a publicly-owned energy company was included in last year's SNP manifesto.

In her keynote speech to the conference in Glasgow, Ms Sturgeon said the idea would now be taken forward, with more detail to be provided when the Scottish government publishes its new energy strategy.

She said: "Energy would be bought wholesale or generated here in Scotland - renewable, of course - and sold to customers as close to cost price as possible.

"No shareholders to worry about. No corporate bonuses to consider. It would give people - particularly those on low incomes - more choice and the option of a supplier whose only job is to secure the lowest price for consumers."

Nottingham City Council operates a similar scheme through its not for profit Robin Hood Energy company, which was launched two years ago and sells gas and electricity to customers across the UK.

Image copyright Getty Images Image caption The three-day conference was held at the SEC Centre in Glasgow

Analysis by Brian Taylor, BBC Scotland political editor

The SNP are in a holding pattern on a number of topics. On Brexit. On independence. On events in Catalonia, where Ms Sturgeon condemned the EU for failing to condemn the violence of the Spanish police - but stopped short of endorsing Catalan independence. Instead, she again urged talks.

And there is a waiting game too on tax, but the speech was policy rich: Affordable housing, child care, the environment, a new not-for-profit energy company, an end to the public sector pay cap. And much, much more.

These, firstly, are policies designed to improve Scotland and to win public support. They have a function and a life of their own.

But they are also designed to meet a wider public mood. Which is to focus upon the day job, upon the mundane concerns of Scottish society.

Read more from Brian

On her government's childcare plans, Ms Sturgeon told delegates that it had already pledged to almost double free provision to 30 hours a week for all three and four-year-olds and eligible two-year-olds.

Ms Sturgeon said the move will save working parents about £350 a month on the costs of childcare.

And she confirmed that the Scottish government will double the £420m it currently spends on early years education and childcare to £840m a year by 2020.

Image copyright PA Image caption Ms Sturgeon arrived on stage with a packet of Strepsils - a reference to Theresa May's cough-interrupted speech at the Conservative company

Image caption There is overwhelming sympathy for the Catalan government among SNP activists and elected politicians

Ms Sturgeon told the conference: "This is a commitment unmatched anywhere else in the UK. And it's the best investment we can make in Scotland's future."

The first minister went on to say that Scotland's interests were threatened by "chaos" at Westminster, with Labour's position on Brexit "clear as mud" and Theresa May having "lost control".

She repeated claims the EU Withdrawal Bill amounted to a "blatant power grab" on the Scottish Parliament, adding: "We will not allow a Tory government to undermine devolution"

'People of Catalonia'

But she acknowledged the EU was not perfect, and criticised its response to the police violence in Catalonia during the recent disputed independence referendum.

Ms Sturgeon said: "Sometimes it (the EU) fails to live up to its founding values of human dignity, freedom, democracy and equality.

"When the people of Catalonia - EU citizens - were violently attacked by police just for trying to vote, the EU should have spoken up, loudly, to condemn it."

She said it was time for the Spanish government to sit down with the government of Catalonia, adding: "It is time for them to talk and to find a way forward.

"A way forward that respects the rule of law, yes. But a way forward that also respects democracy and the right of the people of Catalonia to determine their own future."

Image copyright PA

How would a state-run energy company work? Analysis by BBC Scotland business editor Douglas Fraser

The promise of a government-owned, not-for-profit energy company has been coming down the pipeline since last year's Holyrood manifesto from the SNP.

Nicola Sturgeon's conference speech made clear that the initial key role will be competing with other energy providers on price.

This implies that commercial firms are making unfair or unreasonable profits.

But there could be more - a lot more. Things like supporting new schemes, district heating projects or investment for renewables

Across the North Sea, in Denmark, the state Energy Agency administers energy and supply, and climate change initiatives.

It has 400 staff, with tasks ranging across energy production, supply, transportation and consumption, including energy efficiency and building standards.

Then there's another model of state-owned energy company - Norway's Statoil.

Read more from Douglas

What are the other parties saying?

Scottish Conservative chief whip Maurice Golden said the one word missing from Ms Sturgeon's speech was "sorry".

He added: "For the last year, Nicola Sturgeon put her reckless plan for a second referendum before her day job. But instead of apologising, the first minister once again showed that the SNP simply doesn't do humility.

"This was a speech that demonstrated the SNP simply doesn't get it. Lacking in humility and failing to listen to people - it's the same old SNP."

Scottish Labour's interim leader, Alex Rowley, claimed the SNP was lacking in fresh ideas, so had instead taken Labour policies, watered them down and attempted to pass them off as their own.

Mr Rowley said: "From a not-for-profit energy company to teacher training bursaries, action on period poverty and promises on public sector pay, this conference shows that it is Labour which is setting the policy agenda in Scotland."

Scottish Greens co-convener Patrick Harvie said Ms Sturgeon's speech "showed yet again how Greens are leading the change in our society, pushing the SNP beyond its comfort zone on everything from publicly-owned energy to lifting the public sector pay cap."

Scottish Liberal Democrat MSP Alex Cole-Hamilton said the SNP hierarchy had attempted to "tiptoe around independence" during the conference - but that the party's members had "reminded them that independence is all the SNP care about".