Usher's ex-wife Tameka Raymond is PISSED over her recent loss in court and believes the ruling could be the result of a biased judge ... so she's gearing up to file an appeal, TMZ has learned.
TMZ broke the story ... Tameka lost a hard-fought custody battle on Friday when a judge ruled in Usher's favor and granted primary custody of their two young children to the singer.
But sources close to Tameka tell TMZ, she feels the ruling was unfair. We're told Tameka recently found out that Usher's lawyer's law firm threw an election fundraiser back in 2008 for the judge who presided over the trial ... and she feels that connection may have influenced the ruling.
According to the campaign contribution report for Judge Lane, the law firm that represented Usher raised $1,278 for Lane in March 2008.
Sources tell us ... Tameka is baffled by the decision because she argued in court that Usher is constantly on the road, where as she has the more stable schedule ... thus it makes no sense to give him primary custody.
We're told Tameka wants to fight the decision ASAP and is interviewing lawyers for an appeal.
We reached out to the judge for comment, but so far no word back.