Rep. Ilhan Omar blames the US for Venezuela’s penury. Go figure. She of all people should know how Marxism can trash a country.

Her birth country, Somalia, was run by the Somali Revolutionary Socialist Party, created by the strongman Siad Barre ­under Soviet guidance in the 1970s, until it ­devolved into chaos in the late 1980s.

Barre fled in 1991 and left behind a failed state. By 1992, that instability had forced Omar and her family to flee to this country. They secured asylum in 1995.

It wasn’t just socialism that sundered Somalia into violence. Its clan culture was thoughtlessly exploited by colonial rulers and then by Barre. But the unaccountability, the single-party rule and the economic mismanagement that always — always — accompany socialism certainly didn’t help.

Same with Venezuela. It’s a country with tremendous potential. Its proven oil reserves of 297 billion barrels are the largest in the world. Like Cuba, its promise of prosperity used to ­attract European immigrants by the thousands.

Any European immigrating to Venezuela today, or Cuba for that matter, should consult a headshrinker or spiritual adviser. From 1999 to the present, the United Socialist Party of Venezuela (PSUV) has run the country into the ground, first with Hugo Chávez, who at least had charisma, and since his 2013 death by his successor, Nicolás Maduro, who doesn’t.

Yet somehow, Omar saw fit to assure viewers of the far-left television show “Democracy Now” that responsibility for the mayhem we see there today rests with the US.

“A lot of the policies that we have put in place has kind of helped lead the devastation in Venezuela, and we have sort of set the stage for where we are arriving today,” she claimed. “This particular bullying and the use of sanctions to eventually intervene and make regime change really does not help the people of countries like Venezuela, and it certainly does not help and is not in the interest” of the US.

No. The bullying hasn’t come from Washington. It has originated from the Miraflores palace, the Venezuelan version of the White House, and from Havana, where the Castro family has been pulling the strings of both Chávez and Maduro for decades.

Slowly at first, the PSUV took control of all of Venezuela’s ­institutions. The judiciary, the Supreme Court, the military top brass, the electoral council — all fell into the maw of the PSUV. This meant that there were no checks and balances, no electoral accountability. The top officials and generals Chávez and Maduro surrounded themselves with became more interested in narco-trafficking than in serving their nation.

Their economic mismanagement eventually caused GDP to shrink, from an estimated $331.6 billion in 2012 to $96.3 billion today. The breadbasket of Latin America became its beggar.

When Venezuela’s inflation rate hit 1.62 million percent this March, it was an improvement — from 2.3 million percent in February. What fuels this hyper-inflation is the Central Bank’s practice of printing more and more money to finance socialist public spending.

The Institute of International Finance estimates public spending equaled close to 40% of Venezuela’s GDP last year. That’s simply unsustainable — something our politicians who promise free tuition, health care and a “living wage” should remember.

How and why did Venezuela follow the siren song of socialism, you might ask? Well, because it was sold as anti-corruption socialism. That marketing idea came from none other than longtime Cuban tyrant Fidel Castro.

In 1990, the Berlin Wall had just fallen, and the Soviet Union was disintegrating. Castro realized that he needed new sources of revenue. And so, with the help of the Brazilian socialist President Luis Inacio Lula da Silva, Castro created a movement called the Sao Paulo Forum to indoctrinate other countries into socialism.

When Chávez, then a young military officer spending time in prison for a failed putsch, was freed in 1994, Castro saw his chance. He invited Chávez to Havana and began using the Forum to groom him to run for office as a populist, which Chávez did in 1998 with well-known success.

Since then, the Castro family has had the same parasitic relationship with Venezuelan oil that it has had with Cuban resources. So much so that, when Chávez died, Castro remarked, “Without Venezuelan oil the revolution will fail.” He added: “Maduro is our man in Caracas.”

Today, Venezuela’s oil industry is a shambles, run into the ground by socialist cronies installed by Chávez and Maduro. Socialism has ruined Venezuela, just as it destroyed Somalia. Why can’t Rep. Omar just admit it?

Mike Gonzalez is a Heritage Foundation senior fellow.