NewYork - Leonard Cohen , who has died at age 82, wandered the world reaching into his own melancholy and emerged as a sublime, spiritual voice for his generation.

Best known as a singer and songwriter, Cohen entered the music industry relatively late and was first a poet, a solitary vocation that suited the personality of the shy and frequently depressed boy from Montreal.

But Cohen, who struggled with stage fright even at the height of his career, went on to record some of the 20th century’s most critically acclaimed, if not always commercially lucrative, songs. They include “So Long, Marianne” and “Suzanne” - named after two of the many women, who became his muses - and the religiously intoned, frequently covered “Hallelujah.” Born into a prosperous Jewish family that had founded synagogues in Canada, Cohen would be hailed as one of the all-time literary greats in his native country. Montreal lowered flags to half-mast Thursday on the announcement of his death.

“No other poet’s music felt or sounded like Leonard Cohen’s. Yet his work resonated across generations,” Canadian Prime Minister Justin Trudeau said. Cohen was a pallbearer at the funeral of his father Pierre Trudeau, also a prime minister.

Cohen was frequently on the move physically and spiritually. In New York, he mingled with avant-garde artists such as painter Andy Warhol and Velvet Underground frontman Lou Reed who, on inducting the Canadian into the Rock and Roll Hall of Fame in 2008, said, “We’re so lucky to be alive at the same time as Leonard Cohen .”

Cohen spent formative years on the Greek island of Hydra — where he could write at a leisurely distance from the world’s tumult — and late in life retreated to a monastery near Los Angeles as an ordained Zen Buddhist monk.

“I never thought I was really one of the big guys. So the work that was in front of me was just to cultivate this tiny corner of the field that I thought I knew something about, which was something to do with self-investigation without self-indulgence,” he told Canadian radio host Jian Ghomeshi in 2009.

- An itinerant observer -

Cohen was also deeply attached to his mother — one book was entitled, in a subtle play on his album title, “Death of a Lady’s Man.” His mother was the daughter of a rabbi but also gave the future artist an early love of music through her Lithuanian traditions.

Cohen’s father, successful clothing merchant who raised the family in bilingual Montreal’s English-speaking community, died when the future artist was nine.

He inherited from his father his impeccable attention to clothing — Cohen’s ritual before every concert was to polish his own shoes — but the lack of a strong paternal figure also offered Cohen a chance for freedom.

Cohen would spend his evenings in the late-night bars and music clubs haunted by the sailors of Montreal - a massive shipping hub before the completion of the St. Lawrence Seaway in 1959.

While his skills at instruments were never what made him famous, Cohen learned the foundations of guitar from a Spanish flamenco player he met in Montreal.

He also owed a debt to Spain through Federico Garcia Lorca, the poet and playwright who so inspired Cohen that he later named his daughter after him.

- Tortured by self-doubt -

Cohen, already acclaimed as a poet, achieved his mainstream breakthrough with his 1966 novel “Beautiful Losers,” a postmodern tale that merges the 1960s hippie era with the Native Canadian past. He completed the book amid debilitating depression.

“I was wiped out; I didn’t like my life. I vowed I would just fill the pages with black or kill myself,” he told The Village Voice in 1967.

Cohen went through another tortured ordeal two decades later when he wrote “Hallelujah,” which took him three years and 70 drafts to complete.

Alan Light, in a 2012 book on the song, wrote that Cohen grew so frustrated that he found himself in his underwear in a hotel room banging his head on the floor, feeling incapable of finishing.

Sung in Cohen’s increasingly husky voice, the song opens with a tale immediately recognizable to students of the Old Testament: “Now I’ve heard that there was a secret chord / That David played, and it pleased the Lord.”

The song was initially rejected by Cohen’s label. But it has since become an anthem of uplift, with celebrated versions by Jeff Buckley and Rufus Wainwright among many others.

More than many artists from the 1960s, Cohen managed to project a cool factor years later with tracks such as 1987’s “First We Take Manhattan,” in which he recites his dark, ironic verse over synth-pop.

Cohen late in his career found himself again performing for another reason — his longtime manager, whom he whole-heartedly trusted, swindled much of his savings.

Cohen, who had looked set to retire in the monastery, returned with albums in 2012 and 2014 and just last month released “You Want It Darker,” on which he appeared at peace with his own mortality.

Cohen was preceded in death in July by Marianne Ihlen, the inspiration for “So Long, Marianne.” In a final letter to Ihlen, Cohen declared his “endless love” for her, writing, “I think I will follow you very soon.”