ZARIA, Nigeria — Fifty four people went on trial in northern Nigeria on Monday on charges connected to allegations that they were celebrating a gay wedding, which are outlawed in the country.

The court began hearing the case against the defendants -- most of whom were not present in court -- who have been charged with criminal conspiracy and holding an illegal gathering.

Demonstrations outside the Nigerian High Commission in Nairobi on February 7, 2014 after Nigerian President Goodluck Jonathan signed a bill into law against gay marriage and civil partnerships. Simon Maina / AFP/Getty Images

Former Nigerian President Goodluck Jonathan signed a bill in 2014 that criminalized same-sex relationships, despite pressure from Western governments to preserve the rights of gay and lesbian people.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

The bill contains penalties of up to 14 years in prison and bans gay marriage, same-sex "amorous relationships" and membership of gay rights groups.

Defense lawyer Kimi Appah said the gathering had been a birthday party held in April to honor a man who appeared in court.

"Police got wind of it, arrested them and made trumped up charges that they are trying to celebrate a gay marriage," he told the court in Zaria, a city in the northern state of Kaduna.

The man appeared in court with three other people. They were charged with criminal conspiracy and illegal gathering, to which they all pleaded not guilty. The other accused were not present in court.

Follow NBC Out on Twitter, Facebook and Instagram