His skull still open, a South African musician with a brain tumor played several notes on his guitar during a successful operation to remove most of the growth.

Musa Manzini's guitar-playing helped guide the medical team in their delicate task while preserving neural pathways, said Dr. Rohen Harrichandparsad, one of the neurosurgeons. Manzini was given local anesthetic during what doctors call an "awake craniotomy" this month at Inkosi Albert Luthuli Central Hospital in Durban.

"It increased the margin of safety for us, in that we could have real-time feedback on what we were doing intraoperatively," Harrichandparsad said Saturday in a telephone interview with The Associated Press.

The procedure is not uncommon, and there have been several cases in other countries of musicians playing an instrument or singing during similar operations. The intention was to test Manzini's "ability to produce music," which requires the complex interaction of pathways in the brain, the doctor said.

Manzini was given his guitar toward the end of the hours-long procedure, as doctors checked that everything was in order.

A photo and video taken by the medical team show Manzini lying with his guitar in the operating room.

"There you are, do your thing," a team member says as he begins playing.

Starting slowly, Manzini picks out a series of notes and eases toward a tune, with the beeping of monitors as accompaniment.

In an "awake craniotomy," some doctors stimulate parts of the brain with a mild electrical current as a way of testing and mapping areas that control key functions such as movement and speech. If a patient struggles to speak when the current is applied to a particular area, for example, doctors know they must protect it during tumor removal.

Despite the procedure's name, patients are given medication to make them sleepy during parts of the lengthy operation.

In 2015, a musician played his saxophone during brain surgery in Spain. An opera singer sang during a brain operation in the Netherlands in 2014.

Dr. Basil Enicker, another neurosurgeon who operated on Manzini, said 90 percent of the tumor was removed and that the musician was at home near Durban and doing well.

"Our main aim was to make sure that we do the best that we can for our patient," Enicker said. He said the response from the public to news of the operation was very positive.

"We are pleasantly surprised," he said.