LAST Wednesday evening, as John Bellany, paintbrush in hand, took his last breath surrounded by his family, his closest friend, Sandy Moffat, and I were talking about him.

An artist of renown himself, Moffat had known Bellany since they were students together in the early 1960s at Edinburgh School of Art.

In hindsight, it was a halcyon time. With poet Alan Bold, Bellany and Moffat formed "the big three", brought together, among other things, by their love of music and a desire to detonate the moribund art scene in Scotland.

Bold, who later became Hugh MacDiarmid's biographer, recalled: "We tended to look at the world as a territory divided between Them and Us. To Them we gladly conceded the concept of life as a long process of building a career and accumulating possessions. As for Us, we were wholly involved in an exploration of aesthetic matters. John Bellany was one of Us."

The art school was lodged in the past and avowedly anti-intellectual. Moffat and Bellany were determined to drag it - screaming if necessary - into the present. In August 1963, during the Edinburgh International Festival, they decided to hold an exhibition of their work on the railings of Castle Terrace. Nothing sold but it was seen by countless passers-by, including Alec Guinness on his way to rehearsals. "Every day he'd place a neatly-folded pound note into our collecting tin," said Sandy, still scunnered that he and Bellany had been too gauche to introduce themselves.

He'd spoken to Bellany as recently as a week past Saturday. "He had some very positive things to say about Gordon Strachan and his effect on the Scottish team ... his final thoughts on the football front." Sandy knew John was perilously ill and that the chances of him ever painting again were non-existent. Nevertheless, he sent him pictures of artists who still managed to paint when sick or aged, among them Frida Kahlo, "old Renoir in his wheelchair", and Henri Matisse. "When Helen [Bellany's wife] showed him the Matisse he demanded that a huge new canvas be brought to his bedside ... but he just didn't have any energy left."

Energy, of course, was what Bellany exuded, as a well does oil. He was ambitious but not in a crass, materialist way. What he aimed to do was test his talent to the limit, to leave nothing undone. He'd heard too many paintings talked out of execution in pubs or abandoned because of some perceived imperfection. Like Bob Dylan, he didn't seem to mind if everything was not quite right. What he wanted to do was simply to paint as well as he could when the urge took him. After all, he was a man in a hurry. He'd come face to face with death before and he was not about to pass up a second chance.

It was the drink that nearly did for him a quarter of a century ago. I did not know him then, but I know people who did and they say he drank as he painted, as if there was no tomorrow, until it seemed, as someone once said, that he'd "deliquesce in front of us".

In Port Seton, where he was born in 1942 and grew up, there were more churches than pubs. There were no artists in the Bellany family, or least none in the conventional sense. Bellany's father, however, was a fisherman who was adept at putting ships in bottles and making model boats. Bellany always said his childhood was idyllic. "There were no strictures. It was all high romance, lyrical ... Love was the great thing."

One of his earliest paintings, done when he was 15, was of his grandfather. But while he looked back on his young life through rose-tinted spectacles he was also aware that happiness was always tempered by tragedy. Such is the nature of fishing communities. The 1881 Eyemouth disaster, when 189 fishermen died, was even in the mid-20th century still raw in the minds of many folk on the east coast who made their living from the sea. But equally affecting for Bellany was the death when he was five of a fellow pupil at his primary school, who slipped from Port Seton harbour wall and drowned.

I first came across Bellany in the 1970s when I was working in the public library in McDonald Road, off Edinburgh's Leith Walk. One of our regular readers was Alan Bold, who was as prolific a poet as Bellany was a painter. It was with Bold and Moffat that Bellany travelled to London for the first time to catch exhibitions by Alan Davie and Oskar Kokoschka. I remember Bellany telling me how after a night in Soho they settled on a bench in Trafalgar Square, where a policeman found them and told them to move. "But," said Bellany, shaking with mirth, "it turned out he was from Tranent and we were given star treatment."

We were talking in his house in Barga in northern Italy. Bellany had somehow learned I was in Italy and had asked if I'd like to pop in and see him. It was 2001, 13 years after he'd been given a new liver. He no longer drank and he looked so well that I thought of Van Gogh and his "lust for life". He and Helen had bought the house a year or so before and were having central heating installed and the wilderness surrounding it tamed. There was, I recall, talk of a flock of sheep being drafted in to help.

It was a wonderful location in which to paint and utterly different from Bellany's usual piscine bailiwick. In the distance was a road along which Roman legions used to march. A few miles to the west were the tree-clad slopes of the Apuan Alps and the marble quarries of Carrara where Michelangelo found the flawless white stone for his sculpture of David. At night the sky was inky black and operatically starry. It had given Bellany fresh impetus and inspiration. His airy studio was filled with paintings of olive groves and vineyards. There was one of the barmaid in a Bargan café with a live ermine draped over her shoulders; another of the owner of a nearby trattoria who had returned to the home of his ancestors after many years in Glasgow.

As the sun sank we talked about his upbringing. When he was a young boy, Bellany said, he drew boats which he'd show to his father, who'd say, "Nothing like it! The masts are wrong, you haven't got any crossbeams in that."

"And at that age it makes you try harder, makes you look harder. And I'd try and get my own back. I'd see if I could fox him. He'd say, 'The derrick's on the wrong side.' And I'd say, 'You haven't looked. They've changed that.' And if I was right I'd be one up.

"So this kind of banter went on. Whereas my grandmother and the women would say, 'Oh, it's really good son!' about whatever I did, giving encouragement. I would do a line drawing of a boat and get a perfect likeness - an almost Holbeinesque likeness! - at the age of five."

For dinner there were four of us: John, Helen, John's sister Margaret, and me. Course after course was presented accompanied by glass after glass of wine. It was a long night that ended with lethal measures of grappa. Bellany was in his element, orchestrating proceedings and surreptitiously taking care of the bill. He was an extraordinarily generous man, often making people he'd met only a few hours before the gift of a painting.

On waking early the next morning, my head not quite my own, I could hear him already pottering about. He made coffee and then he said he would like to paint me if I would agree to wear my rather battered panama hat. It seemed churlish to pass up the opportunity of immortality. At first Bellany called for silence but after about 10 minutes he signalled it was OK to talk.

He mentioned Sean Connery, whose portrait he had been commissioned to paint for the Scottish National Portrait Gallery. He'd struggled terribly to get him right. What was the problem? "I couldn't make him great enough," he said. I replied that he was unlikely to face the same difficulty with me. He had the courtesy to laugh.

I pass that painting daily and when I do I think not of hungover, bleary-eyed me but of the man who painted it. There is never any difficulty in spotting a Bellany: the ripeness of his palate, the haunted, Munch-like figures who look as if they've just had an audience with Beelzebub; the red-nosed, bare-breasted women; the crowded table reminiscent of that for the Last Supper; the plump seagulls; the fish heads; the crucifixes and crucifixions; the boats berthed in Eyemouth and Port Seton.

One of my favourites of his paintings is Mexican Serenade, in which a bow-tied, dinner-suited piano player hovers over his instrument, four fingers poised, ready to strike up a tune. Who else can he be but John Bellany?