Hacking through jungle growth and clearing away rubble, archaeologists made their way to excavate a house buried at the edge of ruins of a large Maya city in the remote Petén lowlands of northeastern Guatemala. Painted Maya Walls Reveal Calendar Writing It turned out to have been the studio for royal scribes with a taste for art and a devotion to the heavens as the source of calculations for the ancient culture’s elaborate calendars.

Inside, two of the three standing masonry walls were decorated with a faded but still impressive mural, including a painting of a seated king with a scepter and wearing blue feathers. It seemed that, like the Alec Guinness character in the 1958 movie “The Horse’s Mouth,” no Maya artist could abide a wall without a touch of inspired paint. The third wall, on the east side, appeared to have served as the scribes’ blackboard.

Painted Maya Walls Reveal Calendar WritingOn its badly eroded surface, along with black-painted human figures, were scrawled Mayan glyphs and columns of numbers in the form of bars and dots (bars for the number 5 and dots for 1), based on observations of motions of the Sun, the Moon and planets. The glyphs were delicately painted in red or black. From time to time, thin coats of plaster had been applied over texts to provide a clean slate for new calculations. Still other texts were incised into the plaster surface.

Painted Maya Walls Reveal Calendar WritingThe early-ninth-century workshop of scribes and calendar priests was the first important discovery in the ruins of a Maya city known today as Xultún, found a century ago but largely unexplored until the past few years. Archaeologists said the calendar writing on the wall appeared to be already well advanced several centuries earlier than the examples previously known, mainly from the Dresden Codex, a bark-paper book from the period shortly before the Spanish arrived in the early 16th century.

Rest assured, however, that nothing written on those walls foretells the world coming to an end on Dec. 21, 2012, as some have feared through a misinterpretation of the Maya Long Count calendar. That date is simply when one cycle of the Maya calendar ends and a new one begins.

The discovery at Xultún, made by a team led by William A. Saturno of Boston University, was reported in the journal Science, published online on Thursday, and at a teleconference with reporters. The National Geographic Society, which supported the excavations, will describe the research in the June issue of its magazine.

“For the first time,” Dr. Saturno said, “we get a real look at this kind of work space in a Maya city and the scribes’ tight connections to the royal court.”

David Stuart, professor of Mesoamerican art and writing at the University of Texas at Austin, who deciphered the glyphs, said, “This is tremendously exciting,” noting that the columns of numbers interspersed with glyphs inside circles was “the kind of thing that only appears in one place — the Dresden Codex.”

Some of the columns of numbers, for example, are topped by the profile of a lunar deity and represent multiples of 177 or 178, numbers that the archaeologists said were important in ancient Maya astronomy. Eclipse tables in the Dresden Codex are based on sequences of multiples of such numbers. Some texts “defy translation right now,” he said, and some writing is barely legible even with infrared imagery and other enhancements.

Dr. Stuart was an author of the report, along with Dr. Saturno; Anthony F. Aveni, professor of astronomy and anthropology at Colgate University; and Franco Rossi, an archaeologist at Boston University.

One goal of the Maya calendar keepers, the researchers wrote in the journal article, “was to seek harmony between sky events and sacred rituals.” They observed that the calculations appeared to represent various calendrical cycles the Maya were noted for: the 260-day ceremonial calendar, the 365-day solar calendar, the 584-day cycle of Venus and the 780-day cycle of Mars.

They said the sets of the Xultún calculations were “undoubtedly carefully contrived” and “may have been devised to create schemes for synchronizing predictable events connected with the movement of Mars, Venus, the Moon and possibly Mercury.” Why these particular calculations, ranging in duration from 935 to 6,703 years, were used is uncertain, the researchers said.

The principal scribe, who may have been related to the royal family, also left his mark on the north wall, near the presumed king’s picture. Four long numbers there represent dates that stretch over 7,000 years. The scientists said this was the first place that seems to tabulate all these cycles in this way. Another number scratched in the plaster records a date that translates to A.D. 813. This was in the last century of the Classic Period, before the Maya civilization collapsed into Post-Classic decline.

Xultún is a 12-square-mile site where archaeologists estimate that tens of thousands of people once lived. Its first temples and monuments were constructed in the first centuries B.C., only five miles from other Maya ruins at San Bartolo, where in 2001 Dr. Saturno uncovered some of the oldest extant wall paintings at a large ceremonial center. The last known carved monument at Xultún dates to A.D. 890, in the twilight of the Classic Period.

One of Dr. Saturno’s students, Maxwell Chamberlain, came upon the scribes’ buried studio two years ago while following looters’ trenches through the rain forest. The first surprise was that any of the paintings and writings had survived the humidity of the Guatemalan lowlands. The building, part of a larger elite residential complex, was designated No. 54 of 56 structures when mapped by Harvard scientists in the 1970s. Archaeologists suspect that thousands of other houses remain uncounted.

Although there may be reasons to worry about the future, the researchers emphasized that nothing in Maya beliefs or calendars warranted hoisting “The End Is Nigh” placards. A change in the Long Count cycle, said Dr. Aveni, an astroarchaeologist, is like the odometer of a car rolling over from 120,000 to 130,000. “The car gets a step closer to the junkyard as the numbers turn over,” he said. “The Maya just start over.”