A man was shot while driving Tuesday night in the Logan Square neighborhood on the Northwest Side.

The 31-year-old was driving when he heard glass break and realized he had been shot in his shoulder at 11:13 p.m. in the 2600 block of North Troy, according to Chicago police.

The man was taken to Swedish Covenant Hospital where his condition was stabilized, police said.

He told police he did not know where the shots came from.

Area North detectives were investigating.