Ken Jeong often plays a doctor on TV, but his real-life medical training helped out tremendously when a woman suffered a seizure during his live show ... TMZ has learned.

Ken was doing a comedy set at Stand Up Live Saturday night in Phoenix, where a lady began seizing in the third row toward the beginning of the show. Eyewitnesses tell us Ken appeared to think it was a heckler, but the audience quickly made it clear she needed help.

As soon as he realized what was happening, we're told Ken hopped off the stage and rushed to the woman's aid. Sources say he cleared the area and attended to her while paramedics arrived. An audience member who was also an EMT assisted as well. Oh, and in case you didn't know ... Ken actually obtained his M.D. back in the '90s. So, he's legit.

Ken stayed with the woman until an ambulance arrived -- we're told at some point she regained consciousness while under his care and was brought back to her feet. She was eventually taken to a hospital, and Ken resumed the show. We're told he quickly addressed the situation, saying he was happy to be able to help ... and got a round of applause.