“I accept it,” Pineda said before Thursday night’s game at Fenway Park. “I know I made a mistake.”

The commissioner’s office announced the ban, which started immediately.

Pineda was ejected in the second inning of Wednesday night’s 5-1 loss at Fenway Park after umpires found the pine tar on his neck.

After the game, Pineda admitted he used the pine tar to help him grip the ball on a cool, windy night.

“I feel so bad,” Pineda said Thursday.

Pineda said he had never used pine tar before this season.

The ejection set off a debate in the baseball world about pitchers who try pine tar, and whether it should be allowed in certain circumstances. Many former aces said they had done it, albeit in a more discreet manner.

Rule 8.02(b) prohibits pitchers from altering the ball to gain an unfair advantage, and forbids them from having a foreign substance on them or in their possession on the mound.

Pineda wasn’t seen with the pine tar in the first inning, when the Red Sox roughed him up. Boston manager John Farrell asked plate umpire Gerry Davis to check Pineda after two fast outs the next inning.

Davis went to the mound, touched Pineda’s neck and ejected him.

Earlier this month, Pineda pitched well against the Red Sox at Yankee Stadium. Television cameras showed a substance on his hand during that outing — Pineda said it was dirt, not pine tar.

Pineda said he didn’t use pine tar in a start against the Chicago Cubs, in between his Red Sox outings.

Among other suspensions of pitchers for pine tar in the past decade, Tampa Bay’s Joel Peralta was penalized eight games in 2012, the Angels’ Brendan Donnelly 10 days in 2005 and St. Louis’ Julian Tavarez 10 days in 2004. The suspensions of Donnelly and Tavarez were cut to eight days after they asked the players’ association to appeal, and Peralta dropped his challenge with no reduction.