Judges who were appointed by Republican presidents hand out longer jail sentences to black people than to white people, according to a new study.

The study was conducted by two Harvard Law School professors using data from over half a million defendants, reports WRAL. The researchers looked at the sentencing habits of around 1400 judges over 15 years using information from databases including the Federal Judicial Center, the U.S. Sentencing Commission and the Transactional Records Access Clearinghouse at Syracuse University. The study also broke sentencing down by gender.

“Republican-appointed judges sentence black defendants to three more months than similar non-blacks and female defendants to two fewer months than similar males compared to Democratic-appointed judges,” the study concluded. “These differences cannot be explained by other judge characteristics and grow substantially larger when judges are granted more discretion.”

The type of crime also affects the judges’ sentencing habits.

“We find evidence that gender disparities by political affiliation are largely driven by violent offenses and drug offenses,” wrote the authors. “We also find that racial disparities by political affiliation are largely driven by drug offenses.”

The study also noted Republican judges are tougher on crime in general, handing out sentences 2.4 months longer than their Democratic counterparts. Judges in states with higher levels of racism (measured by interracial marriage opinion polling) were found to be harsher on black people.

The race of the judges proved to be another contributing factor. Black judges were found to treat male and female offenders more equally than white judges. Black judges appointed by Republicans were found to be more lenient than other Republican judges.

The study also concluded the number of Republican appointees from the Trump administration could widen sentencing gaps.

“Our estimates suggest that a 10-percentage point increase in the share of Republican-appointed judges in each court would increase the racial sentencing gap by approximately five percent and the gender sentencing gap by roughly two percent,” the authors wrote. “During an average four-year term, a Republican president has the potential to alter the partisan composition of the district courts by over 15 percentage points, potentially increasing the racial and gender sentencing gap by 7.5 and three percent, respectively.”