Four teenagers who allegedly released capsicum spray in one of Sydney's busiest pedestrian tunnels have been arrested after dozens of people were affected by fumes that caused coughing and eye irritation.

The Devonshire Street tunnel, running between Ultimo and Surry Hills near Central Station in the CBD, was closed just before 4:00pm on Friday, and again about an hour later.

Witnesses described seeing people running for the exits, coughing and covering their eyes, about 3:30pm after a man was seeing releasing gas from a can.

The tunnel was reopened shortly after closing, but closed again within an hour after a similar incident.

Police said a number of people were assessed by paramedics at the scene.

Superintendent Josh Turner, from Fire and Rescue NSW, said the teenagers were seen on CCTV and police began looking for them soon after the incident.

"HAZMAT crews have been able to identify the substance as a capsicum spray," he said.

"This spray is non-toxic, but it's a high irritant to anyone that comes in contact with it and it irritates for a short period of time."

Three people complained of sore throats and irritated eyes after being exposed, with one woman receiving oxygen treatment from paramedics at the scene.

The men, aged 18 and 19, were arrested by Police Transport Command officers.

The 19-year-old man has been charged with using a prohibited weapon and endangering passengers on railway. He has been granted conditional bail and is due to appear in court next month.

The three other men were released as police continue their investigations.