The Massachusetts Ethics Commission and a Democratic gubernatorial candidate are engaging in a rare public back-and-forth.

The state ethics commission has ruled that state Sen. Dan Wolf, from Harwich, cannot be governor, and can’t even continue to serve in the legislature, unless he gives up his 23 percent interest in Cape Air. The reasoning is that the airline has contracts with Massport, allowing it to fly in and out of Logan International Airport, and state law prohibits officials from having a financial interest in state contracts.

On Wednesday, Wolf vowed to stay in the race and appeal the ruling. He implied the ethics opinion came as a surprise because the commission staff had led him to believe that there was no conflict.

Support for GBH is provided by:

In an unusual move, the ethics commission shot back at Wolf the next day, contradicting his claims outright.

“Senator Wolf was never led to believe that no conflict existed; in fact, he was advised that he likely had a substantial problem under the conflict law,” the commission said in a statement.

Wolf isn’t showing signs of backing down. He put out a statement insisting he would make an excellent governor.

He begins a statewide campaign tour on Tuesday.