From his earliest days in office, Sanders aimed to execute his own foreign policy, repudiating President Ronald Reagan’s aggressive support for anti-Communist governments and resistance forces, while going further than many Democrats in backing socialist leaders.

In an article Friday, The New York Times detailed Sanders’ foreign policy views during his mayoralty, including on the Sandinista government in Nicaragua and on the Soviet Union, and how his activities at the time brought into relief the fervently anti-imperialist worldview that would continue to guide him.

Sanders, who is running for the Democratic nomination for president, initially declined an interview request for the article. But after it was published, he requested a phone interview.

The following is an edited and condensed version of the conversation.

Sanders: Let me just say this: I plead guilty to, throughout my adult life, doing everything that I can to prevent war and destruction.

As a young person, long before I ever held any position, I was active in opposition to the war in Vietnam. As a mayor, I did my best to stop American foreign policy, which for years was overthrowing governments in Latin America and installing puppet regimes.

I did everything that I could as a mayor of a small city to stop the United States from getting involved in another war in Central America trying to overthrow a government.

I am very proud that in my small city, we established two sister-city programs which I believe honestly are still going on today — one with Yaroslavl, a city in Russia, the other with a city, Puerto Cabezas in Nicaragua. And I happen to believe that cultural exchanges and student exchanges are a very important tool to try to bring people together and avoid wars.

While we’re at it, I also helped lead the opposition to the war in Iraq, I voted against the first war and I voted against the second war. I’ve done everything I can to try to get the United States out of Yemen in a war that is causing unbelievable destruction in that country. And I will do everything I can to see us not getting involved in a war in Iran.

That is my view, and I make no apologies for it.

NYT: In the top of our story, we talk about the rally you attended in Managua, and a wire report at the time said that there were anti-American chants from the crowd.

Sanders: The United States at that time — I don’t know how much you know about this — was actively supporting the Contras to overthrow the government. So that there’s anti-American sentiment? I remember that, I remember that event very clearly.

NYT: You do recall hearing those chants? I think the wire report has them saying, “Here, there, everywhere, the Yankee will die.”

Sanders: They were fighting against American —— Huh huh —— yes, what is your point?

NYT: I wanted to ——

Sanders: Are you shocked to learn that there was anti-American sentiment?

NYT: My point was I wanted to know if you had heard that.

Sanders: I don’t remember, no. Of course there was anti-American sentiment there. This was a war being funded by the United States against the people of Nicaragua. People were being killed in that war.

NYT: Do you think if you had heard that directly, you would have stayed at the rally?

Sanders: I think, Sydney, with all due respect, you don’t understand a word that I’m saying.

NYT: Do you believe you had an accurate view of President [Daniel] Ortega at the time? I’m wondering if you’re ——

Sanders: This was not about Ortega. Do you understand? I don’t know if you do or not. Do you know that the United States overthrew the government of Chile way back? Do you happen to know that? Do you? I’m asking you a simple question.

NYT: What point do you want to make?

Sanders: My point is that fascism developed in Chile as a result of that. The United States overthrew the government of Guatemala, a democratically elected government, overthrew the government of Brazil. I strongly oppose U.S. policy, which overthrows governments, especially democratically elected governments, around the world. So this issue is not so much Nicaragua or the government of Nicaragua.

The issue was, should the United States continue a policy of overthrowing governments in Latin America and Central America? I believed then that it was wrong, and I believe today it is wrong. That’s why I do not believe the United States should overthrow the government of Venezuela.

NYT: I’m wondering if now you view Ortega and the government differently knowing what you do now?

Sanders: Well, this is now 30 years later, right?

NYT: Something like that.

Sanders: I am very concerned about the anti-Democratic policies of the Ortega government, yes.

NYT: Is there anything you believed about Latin America or the Soviet Union in the 1980s that you no longer believe today?

Sanders: No. The Soviet Union was an authoritarian dictatorship, and that’s what I believed then and that’s what I believe the case to be today. That’s what they were.

On the other hand, I was going to do everything that I could to prevent a nuclear war between the United States and the Soviet Union.

NYT: During your visit to Yaroslavl, you contrasted the American and Soviet economic systems and praised aspects of the Soviet system, like the free provision of health care and the efficiency of mass transit. Do you still admire those aspects of the Soviet system?

Sanders: The principle of providing free health care to all is absolutely right.

The truth also is the Soviet system — the quality of care in the Soviet Union — was not particularly good. But the principle of providing free health care or the principle of providing affordable housing is a good principle. The quality of housing in the Soviet Union was not particularly good. So what the Soviet Union did is provided things to people either free or inexpensively, but the quality was not very good.

NYT: You consistently described American defense and weapons spending as draining the country’s social welfare and municipal infrastructure. As president, how much would you seek to shift funds away from the military and toward social welfare?

Sanders: I don’t know what the word social welfare means. What does that mean? Does that mean rebuilding our crumbling infrastructure? Is that called social welfare? Does that mean making public colleges and universities tuition-free?

I think we must maintain a strong defense, but I think military spending can be cut, and that money can be used to make sure that our kids are able to get a quality education, that we rebuild our crumbling infrastructure.

NYT: Can you describe what foreign policy under President Sanders would look like? You talk a lot about diplomacy, and when you were mayor, you talked about person-to-person contact. What does that look like?

Sanders: It means working with our allies to try to resolve the very difficult international conflicts that exist all over the world. It means putting money into the State Department, having the best diplomat that we can to try to bring people together.

Now, right now, John Bolton apparently is itching for a war in Iran. In my view, what we should be doing is telling Saudi Arabia — which is a despotic, murderous regime — that they have got to start sitting down and negotiating with Iran to create peace in the region, not to make even worse a very volatile situation.

I actually agreed with Trump — one of the very few times I did — in terms of his willingness to sit down with [North Korean leader] Kim Jong Un and try to work out the very difficult situation of North Korean nuclear weapons.

But basically what it means is using our incredible resources to try to bring warring factions together. We have the best military in the world, and at points it may be that I’m not a pacifist and it may be necessary to use that military.

I think we go as far as we possibly can to try to bring about diplomatic solutions to problems and not engage in military conflict.

NYT: Do you think your view on foreign policy, and how to conduct it, separates you from other Democrats?

Sanders: Well, I believe the United States is the wealthiest and most powerful nation on Earth. So I believe — and don’t hear me to say otherwise — that the United States must play a leading role in the world on international affairs. I believe that. I don’t believe that we should go about overthrowing governments, and I don’t believe that we should be engaged in endless wars. But the United States has the capacity to — with its wealth and with its military power — to do everything possible to support democracy and human rights and peaceful resolutions to international conflict.

If that separates me from other Democratic candidates, so be it.