When an artist is commissioned to paint the Duke of York at Buckingham Palace, he wants to get it just right.

For portrait painter James Potter, the opportunity of painting Prince Andrew in military uniform was the pinnacle of his career.

He spent hours catching the light on the Prince's face, the glint in his eye and the ambience of the surroundings.

However, he was not accounting for one thing and the oil painting recorded the ultimate mistake - Prince Andrew was wearing his green military sash on the wrong side.

In the painting, his sash was seen draped by the side of the plinth on which he was leaning, hanging from his right side. It should have been hanging on his left, draped behind his sword where it must always be worn according to military dress code.

Yet this mistake was not noticed until after the lifesize painting was completed.

It was spotted by a military man after having sat in a colonel's office in Omagh, Northern Ireland, for two weeks.

James, 31, from Chichester, said: "The Royal Irish Regiment phoned me and told me about the sash. They said it would have to be repainted and sent it back to me.

"It turned out Prince Andrew had been wearing the sash wrongly. So I don't know what happened there or who was dressing him that day. I still don't think the Prince knows about the mistake."

James was forced to paint over the military sash and repaint it on the other side.

He said: "It was a complicated job as I had to invent parts of the picture without any references."

The picture was sent back and, much to James' relief, got the thumbs up.

The painting was the result of almost two months' work by James.

He visited the Prince, Colonel in Chief of the Royal Irish Regiment, in the room reserved for portrait paintings at Buckingham Palace.

Adjutant Peter Greening, based at the regiments barracks, said: "No one really saw the painting at first as it was not in a frame. But the regimental ser-geant major spotted the mistake immediately."

The painting now hangs in the officers' mess at St Lucia barracks in Omagh, Northern Ireland.