An MSP has denied giving his first wife a black eye days before their wedding but admitted he was having an affair when his second wife was pregnant with their third child.

Bill Walker also admitted ­striking his stepdaughter with a saucepan during a row but insisted it was in self defence.

Giving evidence at his trial at Edinburgh Sheriff Court, the ­politician said he regretted embarking on the "flirtation" when his second wife Anne Gruber was pregnant with their son Douglas in the 1970s.

He insisted he was not with the unnamed American woman on the night his child was born. He said: "That's the most ­hurtful thing I've heard said in this trial."

The 71-year-old is accused of a string of attacks against his three former wives and a stepdaughter between 1967 and 1995.

Walker is alleged to have assaulted Mrs Gruber 15 times at various addresses in Edinburgh and Midlothian between 1978 and 1984.

In the witness box, he said they wed in 1970 but the marriage became "a bit rocky" in 1977.

He told the court: "At the end of 1977 I had a long-range but short-lived flirtation or affair with an American woman. It was a 4000-mile affair which I very much regret."

Mr Walker said the affair took place when Mrs Gruber was pregnant and she found out about it.

The court previously heard Mrs Gruber told her health worker her husband was with another woman when Douglas was born. However, Mr Walker said he was at home looking after the couple's other children at the time. He said he was disgusted at himself for having the affair and his wife would not believe that it was over.

Walker denied punching Mrs Gruber in the face on an occasion after the birth, saying he fended her off in self-defence after she pushed him away from his son's cot.

The MSP is also alleged to have attacked his stepdaughter, Anne Louise Paterson, with a saucepan in January 1978.

In her evidence, Mrs Gruber, 71, said the family were having a last meal together before she moved out with the children when an argument began after Walker insulted the trifle she made.

Walker told the court he had acted in self-defence after his step-daughter attacked him and knocked his front tooth out. He said: "I hit her over the head in self-defence to get her off me, twice I believe, and the handle broke."

Mrs Gruber moved with the children to an address in Liberton, Edinburgh, after the couple separated, the court has heard.

She said she got the "fright of her life" when he leapt into her house brandishing an airgun on her birthday, June 20 1981.

However, Mr Walker said he had gone to the house as she had not turned up for a date and said he found her there with another man. He also said he was carrying a black contractible umbrella, not an air rifle, at the time.

Earlier the independent member for Dunfermline denied giving his first wife Maureen Traquair a black eye two weeks before their wedding.

He is alleged to have assaulted Mrs Traquair, 66, on three occasions between 1967 and 1988.

She told the court she had to buy concealer for their wedding day in January 1967 to hide a black eye he gave her two weeks before.

In the witness box, Walker said he had not punched her in the face during an argument before their marriage and denied assaulting her during their relationship.

Walker denies 23 charges of assault and one breach of the peace. He has lodged special defences of self-defence in relation to three of the charges. The trial continues.