A 23-year-old Chicago man was attempting to take a photo from atop the historic Intercontinental Hotel when he fell 22 feet down the building's smokestack and later died, authorities said Thursday.

It took rescue crews four hours to pull Nicholas Wieme, 23, from the angled portion of the smokestack where he was wedged. The fall happened in an area of the Michigan Avenue hotel that is closed off from the general public, officials said.

"We had to send members from the top down on ropes to assess his condition. The whole time we're monitoring the situation for toxic gases," said Michael Fox, the Chicago Fire Department's special operations chief. "We found the best way to get out him was to go about two floors below, and we had to cut the duct work for the chimney, which was made out of steel. And eventually we ended up sliding the victim down into the hole and removing him from the building."

After the spot where he was wedged, the chimney is vertical for about 42 floors.

"It turned very precarious, because two foot after where we made the hole was a drop that would have went 42 floors to the basement, so it took us a little time to cut the hole in the right spot, and shore it up, so when we brought him out he would not fall into the basement," Fox said.

During the rescue operation, Wieme spoke to firefighters and used his cellphone to contact his girlfriend, who was on the roof with him and had called 911 after he fell. He apparently lost consciousness before he was pulled from the smokestack because he eventually stopped talking, authorities said.

Wieme was taken to Northwestern Memorial Hospital, where he was pronounced dead early Thursday.

In a statement Thursday, the hotel's general manager, Raymond Vermolen, said his staff is cooperating fully with authorities' investigation.