A federal jury convicted the co-founder of a Wayzata oil services company and his associate of multiple fraud charges Tuesday for their roles in what prosecutors described as a complex stock manipulation that triggered more than $30 million in illegal bonus payments.

Jurors found Ryan Gilbertson, 42, guilty of all but one of the 22 counts for which he stood trial for 10 days in Minneapolis. Co-defendant Douglas Hoskins, 50, accused of aiding and abetting the scheme, was convicted on six counts and acquitted on 10 others. Gilbertson, of Delano, and Hoskins, of Wayzata, were first charged in a March 2017 indictment outlining a scheme tied to the 2012 initial public offering for Gilbertson’s Dakota Plains Holdings. Gilbertson controlled about 40 percent of the company’s promissory notes and was entitled to more than $12 million of the $32.8 million in bonus payments.

“Although his scheme was complicated, Gilbertson’s goal was simple — to line his own pockets at the expense of the company and its investors,” U.S. Attorney Erica MacDonald said Tuesday.

William Mauzy, an attorney for Gilbertson, countered that the “complicated set of financial facts” jurors weighed in the case failed to prove “a stock manipulation scheme. Rather, the facts showed that a successful businessman received a substantial but fair return on the large risky loans he provided to Dakota Plains that benefited the company.”

Dakota Plains, involved in North Dakota’s oil industry, went public after a “reverse merger” with a publicly traded shell company in Utah. It filed for Chapter 11 bankruptcy in 2016 and its assets were later sold. Hoskins, a Minnesota real estate agent and semi-professional polo player who played on Gilbertson’s polo team, helped carry out the manipulation scheme by serving as a nominee owner of Dakota Plains stock and selling it at inflated prices when directed by Gilbertson, according to the U.S. attorney’s office.

In February, the U.S. attorney’s office dropped charges against a third defendant, stockbroker Nicholas Shermeta, who testified against Gilbertson earlier this month.

Sentencing for Gilbertson is set for Nov. 13. Hoskins will be sentenced Nov. 15.

Staff writer Mike Hughlett contributed to this report.