About 700 jobs will be created at the plant, which employs 2,100, plus thousands more in the supply chain.
Owner General Motors announced it will invest £125m in the factory and spend about £1bn in the UK component sector.
It was feared that Ellesmere Port could shut under a GM restructuring plan that may still see a European plant close.
Vauxhall chairman Duncan Aldred said it was a "ground-breaking, historic day" for Ellesmere Port and the UK motor industry.
Production of the new Astra will begin at the Cheshire plant in 2015 and run until at least 2020. After the investment, Ellesmere Port will have the capacity to produce up to 220,000 cars annually.
Mr Aldred said Vauxhall would more than double the UK component content in the cars, spending £1bn with contractors, which he claimed would create 3,000 jobs in the supply chain.
As part of an agreement to invest in the factory, Vauxhall workers voted by 94% in favour of a new four-year pay and conditions deal that would enable the plant to work around the clock for 51 weeks of the year if necessary.
Mr Aldred described the flexibility of this deal as "ground-breaking".
He said: "This is great news for the Ellesmere Port plant, our employees, the local community, our suppliers, the Vauxhall brand and the UK. We have been able to develop a responsible labour agreement that secures the plant's future.
"This is assisted by the Government's industrial strategy, increasing its focus on the manufacturing sector and creating ideal ground for companies to build up long-term investments."
Vince Cable, the Business Secretary, told the BBC that no financial inducements were offered to GM.
Mr Cable described the Astra news as "a good story" and said it underlined that the UK "is a good business environment for the motor industry".
He added: "They [GM] wanted an assurance that the government was behind the industry, which we are. The car industry in the UK is a great success story.
"This is a success for team working. We have had business, unions and government working together in a very productive partnership."
The Unite union's general secretary Len McCluskey said: "From a position of uncertainty earlier this year, there is now a potential for a future at the plant until 2020 and beyond.
"Importantly this move will also bring component supplier plants back into the UK, a development that strengthens our manufacturing base generally."
However, he said he recognised that Ellesmere Port's good news could spell bad news for other GM operations in Europe.
auxhall is the UK arm of Opel, GM's European unit. Since 1999, Opel has lost $11bn (£7bn), almost a quarter of it during the last two or three years.
Last year, Opel lost $750m and today's announcement about Ellesmere Port is expected to be accompanied by separate news that a factory in mainland Europe could be shut.
Analysts say that its carmaking capacity is out of step with demand. The company has been working on a restructuring plan for months.
There are fears in Germany that the Opel factory in Bochum is vulnerable to closure.
Bochum produces 30 cars an hour over three shifts a day. Ellesmere Port produces 47 cars an hour over two shifts a day - a company record.
But Germany could yet benefit from an expected decision to move production of its Chevrolet brand from Asia to Europe.
Ellesmere Port plant was thought to be vulnerable because it has traditionally been politically difficult to close plants in mainland Europe.
Analysts also say it is simply cheaper and easier to let workers go in the UK than elsewhere in Western Europe.
But the willingness of unions and workers at the plant to agree to more flexible working arrangements played an important role in GM's decision, as had the government's engagement on the issue in recent months.
In February, Mr Cable flew to the US and met GM's chief executive Dan Akerson and vice-chairman Steve Girsky.
He made the case for why GM should invest in the UK for the long term. Sources suggest the meeting may have played an important role in the company's ultimate decision to back the UK.
Although the government insists that it has not offered the company any up-front cash, there are several sources of money - including the Regional Growth Fund and the advanced manufacturing supply chain initiative - that the company may be able to access.