The Democratic presidential candidates held their fourth debate Sunday, this one in Charleston, South Carolina, and the last before primaries begin. The participants were former Secretary of State Hillary Clinton, Vermont Sen. Bernie Sanders and former Maryland Gov. Martin O’Malley. The debate was sponsored by NBC News and YouTube.

11 p.m.

As the forum moved to a close, O’Malley flashed a broad smile when asked if there was anything he’d like to say that he hadn’t gotten a chance to. (O’Malley seemed to get the least airtime on the night.)

See alsoBush, other GOPers' tweets

The former Maryland governor mentioned immigration reform, the economic crisis in Puerto Rico and the “shameful” role of hedge fund managers in creating it, and the need for a new generation of leaders who could bridge the political divide in the country.

Clinton took an unexpected turn and talked about water contamination in Flint, Michigan, and the government’s apparent slow reaction to help. Clinton said she wanted to be a president who tackled the “big problems and the small” ones such as in Flint.

Sanders returned to Wall Street. He said he agreed with his rivals on the broad strokes of most of the issues. But he said a president must first move to break up the big financial institutions and end big money’s grip on politics.

advertisement | advertise on newsday

10:50 p.m.

Clinton, the first former first lady to run for president, was asked what kind of role her husband, former President Bill Clinton, would have if she was elected. NBC’s Lester Holt asked if it would be a formal role or more like giving advice “at the kitchen table.”

“It will start at the kitchen table,” Clinton said with a smile. “We’ll see how it goes from there.”

@Newsday

She praised her husband’s record on the economy and said she would seek his input.

“I’ll ask for his ideas . . . I’ll use him as a goodwill emissary to go around the country to find the best ideas we’ve got.”

Sanders said Clinton and O’Malley had “great ideas.” But looking to turn back to his criticism of Clinton, he jumped in to say an “administration stacked with Wall Street appointees” would not accomplish much.

10:45 p.m.

Throughout the debate, O’Malley had to fight to get time to talk. Several times, he tried to jump in when the NBC moderators directed questions to Sanders and Clinton.

advertisement | advertise on newsday

When the moderators turned to Clinton after the last commercial break, O’Malley tried to intercept them by requesting: “Can I have 30 seconds?”

Often, he struggled to get into the discussion only to see Sanders or Clinton talk over him.

10:40 p.m.

Fielding another YouTube viewer question, O’Malley moved from talking about technology upgrades to voicing support for privacy laws and making sure the rights of law-abiding citizens aren’t violated.

That segued into questions about monitoring the Internet for “lone wolf” terrorists such as those in San Bernardino, California.

advertisement | advertise on newsday

Sanders said we should “have Silicon Valley help us” to discover information being transmitted by potential terrorists. But he said it could be done without violating privacy rights.

10:35 p.m.

As the discussion moved on to Russia, Clinton paused for a few moments when asked “what is your relationship” with Russian leader Vladimir Putin.

“It’s interesting,” she said with a chuckle. “It’s one of respect. We’ve had some tough dealings with one another. I know that he’s someone you have to continually stand up to because, like many bullies, he’s willing to take as much as he can unless you do.”

Turning to the Islamic State group, Sanders said toppling a dictator such as Iraq’s Saddam Hussein is easy, but the Bush administration had no successful strategy in trying to figure out what happens after. He said he would “train and provide military support for Muslim countries in the area who are prepared to take on ISIS.” He said Qatar, Saudi Arabia and others had to “put some skin in the game” in the fight against Islamic terrorists.

Clinton said “we are in the midst of great turmoil” in the region, with a “proxy” war ongoing between Iran and Saudi Arabia.

Sanders said he largely agreed with Clinton but said the first priority was to “bring all interests together” — including Russia — to destroy ISIS.

O’Malley the United States doesn’t have the security intelligence about the “secondary and tertiary” effects of removing any leaders or factions.

10:25 p.m.

Turning to Iran, NBC’s Andrea Mitchell asked whether the United States should normalize relations with Iran and open an embassy there in the wake of the nuclear deal that keeps that country from getting a nuclear weapon.

Sanders said we should “move as aggressively as we can” to normalize relations with Iran while realizing “we disagree” with so many of that nation’s actions. Still, Sanders said he wouldn’t move to reopen the embassy at this point.

Clinton concurred.

“We’ve had one good day over 36 years,” Clinton said, referring to 1979, when Iran took American hostages after the overthrow of the shah. She said that it was too soon to normalize relations and that Iran still had to answer for “bad behavior” in other Middle Eastern countries.

Sanders jumped in to say he wanted to avoid repeating the “quagmire of Iraq” and “perpetual warfare.”

O’Malley, reminding viewers that he’s the only governor in the Democratic field, said “governors led us to victory” in World War I and World War II.

10:15 p.m.

All three Democrats bashed their Republican rivals for doubting climate change science and not proposing ways to react.

Sanders referred to ice fishermen in his home state who can’t go out on lakes this winter, saying “everyone knows what’s going on” with climate change. He expressed frustration that people could support “someone like Trump, who thinks climate change is a hoax invented by — ” Sanders said, pausing for drama, “the Chinese.”

O’Malley said everyone on the “Democratic stage” believes in science, unlike the Republicans. Trying to tap younger voters and environmentalists, the former Maryland governor repeated he was the lone candidate to have a plan to move to a “clean energy” power grid.

10:10 p.m.

Clinton took aim at Sanders again when she said “I am the only one on stage” who has promised not to raise taxes on the middle class — an element of Sanders’ health care plan.

“There are serious questions about how we are going to pay for what we want to do,” Clinton said.

Sanders said middle-class families would wind up with savings because they would no longer have to pay “$10,000 to Blue Cross or Blue Shield” in private health insurance premiums while paying no more than $5,000 in additional taxes.

“This country bailed out Wall Street. Now it’s time for Wall Street” to help the middle class, Sanders said.

O’Malley said he was the only one who, as a governor, actually balanced budgets during tough times. He too favored higher taxes on the super rich.

10:05 p.m.

Sanders, shouting over both rivals, went back to one of his punching bags: Goldman Sachs. He said the company has supplied treasury secretaries to presidents of both parties and had too much influence — and too many ties to Clinton.

“You’ve received over $600,000 in speaking fees from Goldman Sachs in one year,” Sanders said. He said he found it “very strange” that no one from the big financial institutions had gone to jail for the 2008 economic downturn while “kids who smoke marijuana get a jail sentence.”

10 p.m.

Sanders went on the offensive as the third segment of the debate opened. Told that Clinton also wants to break up the big financial institutions, Sanders replied: “I don’t take money from big banks. I don’t get speaking fees from Goldman Sachs.”

Clinton said Obama too had accepted Wall Street donations. She said Sanders criticized Obama and called him “weak.” She said she would aggressively defend Obama’s record in fighting Wall Street and in the economy after the Great Recession.

Clinton said she had a more comprehensive plan than Sanders for overhauling finances.

“That’s just not true. Oh, come on,” O’Malley said, saying he was the only one to have a plan to put a “cop on the beat” policing the financial system.

“The truth of the matter is, madam secretary of state, you do not go as far as I was in protecting” consumers, O’Malley said.

9:50 p.m.

O’Malley, seeking a different approach, tried to portray himself as someone who could unite opposing factions. Referring to the Democrats on the stage and to the Republican field, he said people didn’t want to hear bashing about billionaires or Muslims.

“How are you going to heal the divisions and the wounds in our country,” O’Malley said. “This is the biggest question facing our country.”

Sanders jumped in to say the first fix had to be reducing the political power of big donors and the “billionaire class.”

9:45 p.m.

Sanders said the Democrats’ back and forth about their opposing plans missed the “main point.”

“The real point is,” Sanders said, harking back to a campaign theme, “we have a campaign finance system that is corrupt.” He said insurance and pharmaceutical companies spend big on campaign contributions and lobbying to fight any change in the current system.

“It’s about whether we have the guts to stand up to the private insurance companies and the pharmaceutical companies,” Sanders said.

He added that “Congress is owned . . . [by big donors] and is failing to do what the American people want.”

Clinton said she “knows something” about being attacked by insurance and pharmaceutical companies, going back to her husband’s first term as president, when she spearheaded his attempts to overhaul health care.

9:40 p.m.

After the first commercial break, Clinton went on the offensive again. This time, it was health care.

Clinton said Sanders was failing to provide specifics about his plan for a single-payer, national health care system.

“He didn’t like that,” Clinton said, referring to her criticism of his plan. She added that she would focus on protecting the Affordable Care Act, or Obamacare, from a Republican repeal and that the Sanders plan would jeopardize that.

“I don’t want to tear it up and start over again,” she said.

Sanders took issue with her characterization.

“That is nonsense,” Sanders said. He said his “Medicare for all” would “finally” provide health care to every child and adult “health care as a right.” He said he wanted to end private insurance to move to a national system.

Clinton replied that what Sanders was touting on the campaign trail was different from the “nine” plans he introduced in Congress.

O’Malley said Maryland built on Obamacare by investing more in prevention.

9:30 p.m.

Taking a question from a YouTube viewer, the debate turned to the issue of deadly police-civilian clashes. Sanders said the U.S. attorney general should be put in charge of investigating the death of anyone in police custody.

“This is a responsibility for the U.S. Justice Department,” Sanders said. He added that local police departments needed to be “demilitarized.”

That segued into questions about the growing problem of opioid and heroin addiction and overdoses.

Clinton said more focus had to be on treatment. She said more jurisdictions should be equipped with overdose antidotes.

Sanders said pharmaceutical companies — and the overprescription of narcotic drugs — also deserved scrutiny.

9:25 p.m.

NBC moderator Lester Holt put Sanders on the spot by noting that black political leaders have said Clinton has their overwhelming support and challenging whether the Vermont senator could win the nomination without stronger support in the minority community.

Sanders replied that the trends favored him — citing Clinton’s dwindling lead in Iowa.

“We have the momentum. We are on a path to victory,” Sanders contended.

9:20 p.m.

Guns became the first flash point in the debate.

Clinton vigorously criticized Sanders for his previous stance to grant gun manufacturers immunity from prosecution for gun crimes — a position he changed in recent days. She said that didn’t change his long record on guns.

“He voted to let guns go on to Amtrak, guns go into national parks,” Clinton said, going after what she perceives is Sanders’ weakness among primary voters. She went on to refer to “one of the most horrific examples, not a block from here, where we had nine people murdered,” referring to the church massacre in Charleston last year.

Clinton said she was happy to hear Sanders had changed his mind.

Sanders said she was distorting his record.

“I think Secretary Clinton knows what she says is very disingenuous,” he said, adding he has had a “D-minus” record from the National Rifle Association and supported President Barack Obama’s proposal to tighten gun-show laws.

“They’ve both been inconsistent on this issue,” O’Malley said. He said he had cracked down on guns in Maryland without impacting anyone’s ability to hunt.

“I never met a self-respecting deer hunter that needed an AR-15 to down a deer,” O’Malley said.

9:10 p.m.

Clinton, who has had strong support among black Democrats, invoked the Rev. Martin Luther King Jr. in her opening statement of the party’s final debate before the upcoming Iowa caucus.

It was a theme all the Democrats would hit in the opening moments of the forum in Charleston, South Carolina.

Sanders (I-Vermont) said “the American people understand that our economy is rigged . . . with all the wealth going to the top 1 or 2 percent.” He said the election was about “not only electing a president but transforming our country.”

O’Malley, who has portrayed himself as the strongest on gun control, talked of reducing violence and lifting the middle class.

A new Iowa poll has added urgency to the race.

A Des Moines Register/Bloomberg Politics survey released Wednesday showed Clinton’s lead narrowing considerably. She led Sanders 42 percent to 40 in the poll — down from nine points just a month earlier.