Image caption The couple brought forward the wedding so that Logan could be there

A two-year-old US boy whom doctors have given weeks to live has served as the best man at his parents' wedding.

Logan Stevenson has acute myeloid leukaemia and has undergone several operations. Late last month doctors said he had only weeks left to live.

The diagnosis prompted Logan's parents, Christine Swidorsky and Sean Stevenson, to bring forward the wedding they had originally planned for July 2014.

It went ahead in the city of Pittsburgh and was a celebration of his life.

Logan was held by his grandmother Debbie Stevenson during the ceremony as he held on to his favourite stuffed rabbit.

"This is our dream come true," Mrs Swidorsky said through tears, the Pittsburgh Post-Gazette reported.

"It's just going to be one of those things that you remember all your life," Mr Stevenson told the paper after the ceremony.

"It means the world to me. We're just blessed every day that he's here with us," he said.

The couple thanked the many people who have donated decorations, food and other gifts for the ceremony.