Barry Shell poses with his cheque for nearly $4.4 million at the OLG office on Monday, shortly before his arrest. ((OLG) )

It was a good news, bad news day for Barry Shell. 

The good news: he won more than $4 million. The bad news: he ended up in jail.

Shell, from Brampton, Ont., picked up a cheque for $4,377,298, the top prize in the July 18 draw for the Lotto 6/49.

"I went to the store and checked my ticket on the self-serve ticket checker," Shell was quoted as saying in a news release from the Ontario Lottery and Gaming Corporation.

"As soon as I saw how much I had won, I grabbed a pen and signed my ticket."

On Monday afternoon, a smiling Shell was photographed holding up his cheque at the OLG headquarters on Dundas Street West in Toronto.

Then Shell strolled out of the building and into the hands of Peel Regional Police officers.

He was wanted on a six-year-old warrant for failing to appear, theft under $5,000 and possession of property obtained by crime.

According to a spokesman for the OLG, every lottery winner undergoes a security check, and if anything is turned up during the course of the investigation the matter is turned over to the Ontario Provincial Police.

Shell, 45, was held overnight and appeared in court on Tuesday. He has been charged and released.

The news release said Shell "has no immediate plans for the windfall."