WALNUT CREEK (KCBS)— A 14-year-old basketball player’s life was saved over the weekend by an Automated external defibrillator (AED) after an apparent heart attack during halftime at a game. The medical device has become standard in all Walnut Creek city facilities.

When the 14-year-old boy collapsed Saturday afternoon at the Contra Costa County Jewish Community Center, a nurse in the audience gave him CPR but Wes Allnut with the City of Walnut Creek, said it wasn’t enough.

READ MORE: Dixie Fire: Thundershowers, Downdrafts Whip Up Flames; Ash Fall 'Looks Like It's Snowing In Quincy'

“The coach ran into our lobby, asked our gym attendant if we had an AED and he said yes, ‘here you go’. So they brought the AED out onto the court,” Allnut said.

It was the electric shock from the AED that brought the boy’s heartbeat back. His dad told Allnutt the boy is recovering at the hospital.

READ MORE: Dramatic Pursuit Video: Brazen Driver Attempts To Elude Arrest By Driving Wrong Way; Two Attempted Carjackings

All Walnut Creek city facilities, especially gyms community centers and golf courses now have these devices.

“Affordability— $2,000, I think it’s something that’s very worth the investment, especially when you can hear the story of a 14-year-old and saving his life,” said Allnutt.

MORE NEWS: Driver Fatally Struck After Leaving Vehicle Involved In San Jose Collision

The incident marks the second time the JCC’s AED has been used to save a life.