Mr. Fox performs at the Maryland Renaissance Festival in September. (Amy Davis/Baltimore Sun/AP)

Johnny Fox, a professional sword swallower and magician who entertained audiences across the country to help them, as he said, “forget about the sadness and the madness” in the world, died Dec. 17 at the home of a friend in Damascus, Md. He was 64.

His death was announced by the Maryland Renaissance Festival in Crownsville, where he had performed for 37 years, including as recently as in October. He had liver cancer, and his death followed two seizures, said his companion, Barbara “Tammy” Calvert.

Mr. Fox was, by his count, one of 20 or fewer sword swallowers in the United States — a group that travels from festival to carnival preserving the traditions of sideshow arts. He did coin tricks as well as comedy and was known, according to the Renaissance Festival, to “drive an eight-inch spike into his nose” and to swallow five-foot balloons.

He swallowed fire until he learned it was detrimental to his health.

But his calling card was his sword act, which he taught himself for job security when he was in his 20s; copycats could and did attempt to replicate his magic shows, but few if any would dare to open wide and turn the sharp end of a sword in the direction of their throat.

Mr. Fox died Dec. 17 at age 64. (Steve Parke)

Thousands if not millions saw his act on the television shows hosted by Merv Griffin and David Letterman. Thousands more watched him perform at Renaissance festivals and other gatherings.

He said the most important trait of a sword swallower was the ability to conquer fear, not to mention the gag reflex.

“You have to surrender and open up,” Mr. Fox told the New York Times in 1999. The trick, he continued, is “the ability to relax and dilate your throat, the pharynx and the epiglottis. . . . When we swallow, they both open.”

To counter suspicions that he was using a retractable blade, he sometimes used a glowing sword that made light emanate from his throat. He was said to swallow swords up to 22 inches long, and up to 16 swords at a time.

In another feat, he swallowed a screwdriver.

“Twist it around a couple of times so my butt doesn’t fall off,” he told NPR in October, “and make sure I do it clockwise, not counterclockwise.”

John Robert Fox was born in Minneapolis on Nov. 13, 1953. An uncle entertained their relatives by inserting needles into his thumb, the Times reported.

Mr. Fox grew up in Connecticut, where he was living when his father took him to the Eastern States Exposition, a New England fair where he saw curiosities including “The Giant From Reykjavik, Iceland, 8-foot-8,” “The Lobster Boy, Alive” and ‘The Monkey Girl, Alive.” Such so-called freaks, he told the Syracuse, N.Y., Post-Standard, were his superheroes because they had “the courage to stand in front of the public, hearing people say nasty things.”

The fair also provided his introduction to sword swallowing. He recalled his brother admonishing him, “Don’t believe it, it’s fake.”

Mr. Fox’s father encouraged the boy’s interest in magic, giving him a book about escape artist Harry Houdini. Mr. Fox began his performing career in Florida but gradually became known across the country. He appeared in a Maalox antacid commercial, munching on lightbulbs.

In New York City, he operated a museum, the Freakatorium, El Museo Loco, that featured such items as a narwhal tusk, a two-headed turtle, conjoined piglets preserved through pickling, and relics billed as clothing having belonged to Tom Thumb and entertainer Sammy Davis Jr.’s glass eye. The museum closed in 2005 after five years because of an increase in rent.

Mr. Fox was married and divorced four times. He lived in Seymour, Conn.

Survivors include his partner of two years, Calvert, of Bowling Green, Ky.; a son from his second marriage, to Susan Kelly, Kelly Fox of Breckenridge, Colo.; a brother; and a sister.

Mr. Fox delighted in providing his audiences with a means of escape from daily life, and the struggle it often entails, with an act that was both difficult to watch and impossible to ignore.

“It’s gross and disgusting I know,” he once told The Washington Post. “But you’ll watch.”