British Olympic medallist Louis Smith has issued an apology after a video appeared online of him mocking the religion of Islam. The 27-year-old shot the footage of himself and former gymnast Luke Carson chanting "allahu akbar" – an Islamic phrase which means "god is the greatest" – while the latter pretended to pray after removing a rug from the wall.

The pair were attending the wedding of gymnast Daniel Keatings in Kettering, according to The Sun, when they engaged in the offensive behaviour, which saw Carson kneel on a rug and bow in mock worship. An elderly woman attempted to intervene as Smith, who was awarded an MBE in 2013 for services to his sport, continued to film the episode before claiming Carson was "doing his six o'clock prayers".

Smith's conduct initially caused outrage on Twitter, with some observers stating the incident was "racist" and that he could not longer be regarded as a role model. The pommel horse silver and bronze medallist from the past two Olympic Games has since responded with a heartfelt apology in which he insists he has learned a "life lesson".

"I am deeply sorry for the recent video you may have seen. I am not defending myself, what I did was wrong," the 2012 Strictly Come Dancing winner said, via Twitter. "I want to say sorry for the deep offense (sic) I have caused and to my family who have also been affected by my thoughtless actions. I recognise the severity of my mistake and hope it can be used as an example of how important it is to respect others at all times. I have learnt a valuable life lesson and I wholeheartedly apologise."

Though Carson retired last year through injury after competing for Northern Ireland at the Glasgow 2014 Commonwealth Games, Smith remains an integral part of the Great Britain gymnastics team and has featured at the past three Olympic Games in Beijing, London and Rio. British Gymnastics has pledged to hold a full investigation into the episode and has threatened to expel Smith from its programme.

"British Gymnastics does not condone the mocking of any faith or religion and is appalled by such behaviours," the statement read. "Gymnastics is an inclusive sport and we are proud of members who portray the inclusive values of British Gymnastics. Members who break our code of conduct can face suspension or expulsion from our organisation. We will be investigating the behaviours reported."