Two inmates burst from their cell at a Rikers Island mental-health clinic Wednesday and attacked six guards before they were subdued with pepper spray, The Post has learned.

“They used a telephone, they grabbed garbage cans, they were throwing anything they could get their hands on,” a union executive board member said of the melee, which took place at about 1:30 p.m. at the Anna M. Kross Center.

The officers were taken to New York Hospital, where one received 19 stitches to his face.

Another officer was treated for a severely bruised jaw, a third for a head wound and three for exposure to the pepper spray.

One of the inmates is awaiting trial for allegedly assaulting a PATH train conductor.

Joseph Cannon, 24, of Lowell, Mass., allegedly walked up to the conductor’s open window, grabbed for his dispatch radio and keys that open and close the doors, then slugged him at the 14th Street station on March 20.

This time, he didn’t need keys.

He and inmate Christian Collazo, 19, who allegedly stole food from a street cart then punched the vendor, were in the cell when an officer opened the door for one of their cellmates to use the bathroom, authorities said.

“The other inmates then bumrushed the officer, and that’s when all of this started,” said Norman Seabrook, president of the city correction officers union.