At least 21 people were injured when as many as two decks at a residential building on the Jersey Shore collapsed Saturday, according to hospital officials and NBC Philadelphia.

Images of the 6 p.m. collapse in Wildwood, New Jersey, appeared to show two decks of the structure sheared off and on the ground as first responders went through the rubble.

NBC Philadelphia reported that firefighters had gathered for an event at the property.

The collapse occurred during the New Jersey State Firemen's Association's 142nd annual convention.

Twenty-one patients were taken to Cape Regional Medical Center, spokeswoman Susan Staeger said. Two of the injured were transferred to a trauma center, she said.

Three were younger than 18, Staeger said. The minors, along with at least 12 others, were treated and released, she said.

NBC Philadelphia reported that firefighters attending the gathering were among those being treated.