A British politician has apologized after it emerged some chaplains with the British armed force told superiors about gay and bisexual military personnel in the 1990s.

The UK dropped its ban on openly LGB people serving in the armed forces in 2000. However, before this time, gay military personnel were routinely dismissed if their sexuality became known.

According to the Times, some chaplains reported LGB personnel to their superiors after hearing the information during confession.

Private confession, as practiced by several denominations of Christian faith, is when a person tells a priest of their sins or wrongdoings. It is supposed to remain confidential and repeated to no-one else.

The newspaper spoke to veterans who say they confided in their chaplain, only to be questioned days later by military police.

Related: Two trainee priests sent back to Ireland after being caught in bed together

It’s believed both Church of England and Roman Catholic chaplains were involved with the practice. It’s uncertain if the information led directly to soldiers being dismissed.

The breach of confidentiality was acknowledged on the weekend by the British government. Defence Minister, Johnny Mercer, MP, told The Times: “Our policy regarding LGB members in the military was unacceptable then, and as a defence minister, I personally apologize for those experiences.”

“Pastoral encounters between service chaplains and personnel should be strictly confidential.”

Related: Navy veteran discharged over sexuality is to get confiscated medal returned

He issued a similar apology last Thursday. At the Houses of Parliament, addressing an audience of veterans to mark 20 years since the gay ban was lifted, he said, “It was unacceptable then and it is unacceptable now, and as the minister for defence, people and veterans, I wanted to personally apologize to you today for those experiences.”

Campaigners say the UK military conducted a “witch hunt” to dismiss gay and bisexual service personnel before the ban being lifted.

Nowadays, all the main strands of the UK armed forces are represented at major Pride festivals, with service personnel marching in uniform. The Ministry of Defence also has its own LGBTQ employee network group, while rainbow flags were raised at several naval bases to mark the 20th anniversary of the ban being lifted.