SAN FRANCISCO — Scholars at the University of California, Berkeley have pieced together a collection of dispatches written by Mark Twain when the author was a young newsman in San Francisco.

In the letters, the man who would write “The Adventures of Tom Sawyer” and its sequel, “Adventures of Huckleberry Finn,” likened the city’s police chief to a dog chasing its tail and accused city government of rascality. Some of the letters carried his flair for embellishment and may not be entirely true.

“This is a very special period in his life, when he’s out here in San Francisco,” said Bob Hirst, general editor of the Mark Twain Project on the Berkeley campus.

“He’s utterly free, he’s not encumbered by a marriage or much of anything else, and he can speak his mind and does speak his mind. These things are wonderful to read, the ones that survived.”

Twain was likely 29 years old when he started filing near-daily columns for the Territorial Enterprise newspaper in Virginia City, Nevada, in 1865. He wrote a 2,000-word story, or “letter,” six days a week for a salary of $100 a month, Hirst said.

Many of the letters were in back issues lost to fires, but Twain scholars picked through archives of other Western U.S. newspapers for copies. They have found about 110 columns written in 1865 and 1866.

In one letter, Twain gives detailed dialogue between two gold speculators trapped in a shaft, clinging to rope tied to an old horse named Cotton.

“Johnny, I’ve not lived as I ought to have lived. D—n that infernal horse!” Twain reported one man saying to the other. “Johnny, if we are saved I mean to be a good man and a Christian.”

It’s unclear how Twain acquired that level of detail. Hirst said the story is likely based on some facts.

Twain was also struggling at the time with his career, uncertain if writing humorously was literature, Hirst said.

In an 1865 letter to his brother, Twain wrote of contemplating suicide, partly due to debt. But Twain’s time in San Francisco may have helped change that. The following year, he moved to Hawaii.