Former Greek finance minister Yanis Varoufakis has claimed capitalism is coming to an end because it is making itself obsolete.

The former economics professor told an audience at University College London that the rise of giant technology corporations and artificial intelligence will cause the current economic system to undermine itself.

Mr Varoufakis, who took on EU institutions over Greek debt repayments in 2015, said companies such as Google and Facebook, for the first time ever, are having their capital bought and produced by consumers.

"Capitalism is breaking": meet the 25-year-old London politician fighting the housing crisis

“Firstly the technologies were funded by some government grant; secondly every time you search for something on Google, you contribute to Google’s capital,” he said. “And who gets the returns from capital? Google, not you.

“So now there is no doubt capital is being socially produced, and the returns are being privatised. This with artificial intelligence is going to be the end of capitalism.”

Warning Karl Marx “will have his revenge”, the 56-year-old said for the first time since capitalism started, new technology “is going to destroy a lot more jobs than it creates”.

Stephen Hawking has a terrifying warning about artificial intelligence

He added: “Capitalism is going to undermine capitalism, because they are producing all these technologies that will make corporations and the private means of production obsolete.

“And then what happens? I have no idea.”

Describing the present economic situation as "unsustainable" and fearing the rise of "toxic nationalism", Mr Varoufakis said governments needed to prepare for post-capitalism by introducing redistributive wealth policies.

He suggested one effective policy would be for 10 per cent of all future issue of shares to be put into a "common welfare fund" owned by the people. Out of this a "universal basic dividend" could be paid to every citizen.

In pictures: Artificial intelligence through history Show all 7 1 /7 In pictures: Artificial intelligence through history In pictures: Artificial intelligence through history Boston Dynamics Boston Dynamics describes itself as 'building dynamic robots and software for human simulation'. It has created robots for DARPA, the US' military research company In pictures: Artificial intelligence through history Google's self-driving cars Google has been using similar technology to build self-driving cars, and has been pushing for legislation to allow them on the roads In pictures: Artificial intelligence through history DARPA Urban Challenge The DARPA Urban Challenge, set up by the US Department of Defense, challenges driverless cars to navigate a 60 mile course in an urban environment that simulates guerilla warfare In pictures: Artificial intelligence through history Deep Blue beats Kasparov Deep Blue, a computer created by IBM, won a match against world champion Garry Kasparov in 1997. The computer could evaluate 200 million positions per second, and Kasparov accused it of cheating after the match was finished In pictures: Artificial intelligence through history Watson wins Jeopardy Another computer created by IBM, Watson, beat two champions of US TV series Jeopardy at their own game in 2011 In pictures: Artificial intelligence through history Apple's Siri Apple's virtual assistant for iPhone, Siri, uses artificial intelligence technology to anticipate users' needs and give cheeky reactions In pictures: Artificial intelligence through history Kinect Xbox's Kinect uses artificial intelligence to predict where players are likely to go, an track their movement more accurately

Mr Varoufakis came to prominence during the Greek sovereign debt crisis when he led Greece’s negotiating team seeking a resolution with its international creditors.