Two Mexicana stamps feature El Chavo del Ocho and El Chapulín Colorado, characters created by the Mexican comedian Roberto Gómez Bolaños. (Dario Lopez-Mills/AP)

Roberto Gómez Bolaños, the Mexican comedian who wrote and played the boy television character “El Chavo del Ocho” who was beloved by millions of Latin American children, died Nov. 28 in Cancun. He was 85.

The Mexican television network Televisa announced the death, and numerous news agencies later reported the cause as a heart attack.

Mr. Gómez Bolaños changed comedy in Latin America, taking his inspiration from Laurel and Hardy as well as Mexico’s other transcendent comedian who eventually made it to Hollywood, Cantinflas.

Mr. Gómez Bolaños’s two most famous characters were El Chavo del Ocho, who lived in the homes of Latin America and beyond with his barrel, freckles, striped shirt and frayed cap, and the naive superhero El Chapulín Colorado, or the Crimson Grasshopper. His show was a staple for preschoolers, much like “Captain Kangaroo” in the United States.

His clean comedy style was far removed from the sexual innuendo and obscenity-laced jokes popular today. In a career that started in the 1950s, he wrote hundreds of television episodes, 20 films and theater productions that drew record-breaking audiences.

His prolific output earned him the nickname Chespirito (chess-pee-REE-to). It came from the Spanish phonetic pronunciation of Shakespeare — “Chespir” — combined with “ito,” a diminutive commonly used in Mexico that seemed natural for Mr. Gómez Bolaños because of his short stature.

On Friday, Mexican President Enrique Peña Nieto tweeted, “Mexico has lost an icon whose work has transcended generations and borders.”

Roberto Gómez Bolaños, whose father was a renowned painter and illustrator, was born in Mexico City on Feb. 21, 1929. He trained as an engineer, but he was dedicated to writing from a young age and initially worked in advertising and then for Mexican television shows.

He achieved smashing success in 1970 with the creation of “Chespirito,” a television show that included segments about the Crimson Grasshopper.

The character was introduced via an announcer: “More agile than a turtle, stronger than a mouse, nobler than a lettuce, his coat of arms is a heart . . . It’s the Crimson Grasshopper!”

The goofy superhero dressed in a red bodysuit and hood with antennae that helped him detect danger miles away. He completed the outfit with yellow shorts and boots, giving him the look of a red bumblebee. The character, whose superpowers included shrinking to the size of a pill and dodging enemies, constantly repeated his signature phrases, “You didn’t count on my cleverness” and “All the good people, follow me.”

In 1971, Gómez Bolaños wrote and acted as “El Chavo del Ocho” (“The Boy From the Eight”), a reference to the channel that broadcast the show.

“El Chavo” proved so popular that reruns are still shown in multiple countries in Latin America and on Spanish language television in the United States. Many Latin Americans, living under dictatorships during the height of the show, found his underdog triumphs heroic in the face of authority.

In a 2005 interview with the Mexican newspaper La Jornada, Mr. Gómez Bolaños said he always wrote with working-class people in mind.

“There are writers who pour out words, concepts that sound really important but that basically say nothing,” he said. “I always tried to be as concise as possible, all to try and reach everyone, but especially the simple people, those who needed to be reached more than anyone else.”

He also delved successfully in theater for adults. In 1992, he produced, directed and acted in “11 and 12,” the story of a man who loses his genitals in an accident and wants to impregnate his wife. The play set a record in Mexico, surpassing 3,200 performances.

Proof of his wide popularity came when he opened a Twitter account in 2011 with a simple message: “Hello. I’m Chespirito. I’m 82-years-old and this is the first time I tweet. This is my debut. All the good people, follow me!”

In less than two months, he had 1 million followers. By the time of his death, there were 6.6 million. TVGuide.com reported that the outpouring of condolences made him the top trending topic Friday on Twitter, beating the new “Star Wars” movie trailer and Black Friday conversation.

Survivors include his wife, actress Florinda Meza, six children from his first marriage, to Graciela Fernandez, and 12 grandchildren.

— Associated Press