The Office of Government Ethics strongly reprimanded Commerce Secretary Wilbur Ross for his failure to completely divest himself of his far-flung stock holdings in a timely fashion and for taking short positions in an effort to offset certain stocks until they could be sold.

Ross replied by saying that even though his ethics agreement allows him to retain private equity holdings, he will now sell all his holdings and put them in Treasury securities in order “to maintain the public trust.”

David J. Apol, acting director and general counsel of the ethics office, told Ross that “your failure to divest created the potential for a serious criminal violation on your part and undermined public confidence.”

In a letter posted on the Web, Apol added that “your actions, including your continued ownership of assets required to be divested in your Ethics Agreement and your opening of short sale positions, could have placed you in a position to run afoul of the primary criminal conflict of interest law.”

The Office of Government Ethics did not recommend any punishment, however, saying “we have no information to contradict” Ross’s assertions that his failure to sell all his massive stock holdings was “inadvertent.” And it said that an examination of Ross’s calendar, briefing books and correspondence did not turn up any evidence of a criminal violation.

But the ethics office said that “even inadvertent errors regarding compliance . . . can undermine public trust in you and the overall ethics program.”

When Ross became commerce secretary after a successful career as an investor and investment manager, he vowed to sell off his approximately $800 million in assets to avoid any conflicts of interest. And he did sell much of the holdings while putting others in trust for his family. On Nov. 1, 2017, he signed a statement to the office that he had fully divested himself of stocks.

But in disclosure statements filed with the Office of Government Ethics over the past six months, Ross has revealed that he had continued to hold shares of five companies after the deadline for divestment. That included Invesco, the fund he had long managed. In December, Ross sold two tranches of Invesco in amounts of at least $5 million each.

“My investments were complex and included hundreds of items,” Ross said in a statement posted on the Commerce Department website Thursday night.

Ross said earlier that he had overlooked some of his holdings because they were shares given to him as a director of the companies and they had been held by trustees in different accounts.

Ross said that once he learned of the holdings he opened short positions — normally a way for sophisticated investors to bet a stock price will fall by selling borrowed shares. Ross said he took short positions to offset stock holdings that couldn’t be sold right away because they needed to be moved to his brokerage account.

Apol, however, called the short positions “an ineffective attempt to remedy your actual or apparent failure to timely divest assets” as agreed. Apol said Ross should seek guidance from his ethics officer “before engaging in any self-help to try to remedy any ethics-related situations that may arise in the future.”

Ross failed to sell all his shares of Invesco, the large fund he managed; Navigator Holdings, a shipping company that did business with a well-connected Russian firm; a leading air leasing company called Air Lease; Sun Bancorp; and Greenbrier.

Apol noted that Ross would soon be filing his annual ethics statement. “I urge you to devote the resources necessary to ensure that your report and all future communications with OGE are complete and accurate,” Apol wrote. “The American public needs to have confidence that Government officials take their ethical commitments seriously.”

In his statement Thursday, Ross reiterated that his errors were “inadvertent” and said, “I take my ethics obligations very seriously.”