Daniel Johnston, an eccentric, enduring and much beloved figure in the US indie rock scene, has died aged 58 following a heart attack. The news was confirmed by his manager Jeff Tartakov.

Numerous cultural figures have paid tribute to the cult songwriter – once a favourite of Kurt Cobain – including Beck, Judd Apatow and Ezra Furman, who described him as “one of my best teachers”. Actor Elijah Wood wrote: “What a gentle, beautiful treasure. So sad to hear you’ve left us.”

Born in California in 1961 and raised in West Virginia, Johnston became known as a songwriter after moving to Austin, Texas. His popularity grew in the city after he started handing out tapes of his affectingly naive songwriting to people in the street, and began recording numerous albums. Cobain’s patronage prompted a bidding war to sign him, and he eventually signed to major label Atlantic in 1994, though mainstream success eluded him.

In the early 1990s, he suffered a manic psychotic episode during a plane flight, when, believing he was the cartoon character Casper the Friendly Ghost, he threw the ignition keys for the plane out of its window – he and his father escaped with minor injuries following the subsequent crash. It prompted one of many spells in psychiatric institutions, and he was diagnosed with schizophrenia and bipolar disorder. Over the years he also suffered from diabetes, kidney infections and hydrocephalus; last year he was hospitalised following a fall.

His eccentricity was legendary – he refused to sign with Elektra because they also employed Metallica, whom Johnston regarded as satanic; he ran away from home as a teenager on a moped to join a travelling carnival; he was arrested for graffiti-ing the Statue of Liberty with hundreds of Christian fish symbols. But as another admirer, Wilco frontman Jeff Tweedy, said in 2017: “Daniel has managed to create in spite of his mental illness, not because of it. He’s been honest in his portrayal of what he’s been struggling with without overtly drawing attention to it.”

His health issues contributed to a long break from album releases beginning in the mid-1990s, but he returned in 2001 with Rejected Unknown and maintained a steady release schedule since. 2004 saw the release of an album of cover versions of his work by performers including Tom Waits, Beck, Bright Eyes and TV On the Radio. His most recent album was 2012’s Space Ducks.

A documentary film, The Devil and Daniel Johnston, was released in 2006 and won the Director’s Award at the Sundance film festival; a biopic starring Johnston as himself was released in 2015, entitled Hi, How Are You Daniel Johnston?

Johnston was also known as an artist and comic-book writer, with his image of a happy frog under the words Hi, How Are You? – used on the cover of his 1983 album of the same name – turned into a popular mural in Austin; the city also named 22 January, Hi, How Are You? Day. In 2006, his artwork was featured in a major exhibition at New York’s Whitney Museum of American Art.

Johnston recorded 17 albums in all, and last year said he had been recording material for a new LP “for years”.