(CNN) -- An Illinois lesbian couple's love story is one for the history books.
Vernita Gray will marry the woman she loves, Pat Ewert, this week. That's seven months before the marriage equality law takes effect in the state.
A federal judge made an exception for Gray, who is battling bone and brain cancer. Her wish is to be formally married before she dies.
Gray, 64, said getting married will ensure her benefits extend to her partner.
"I worked my whole life. I have a pension, I have social security," Gray told CNN affiliate WGN. "These are the things we work for in life to help our families, not just to disappear because I'm going to leave this earth."
Illinois became the 16th state in the nation to legalize same-sex marriage when Gov. Pat Quinn signed the Marriage Fairness Act last week. But the law does not go into effect until June 14, which prompted the couple to file a lawsuit in federal court.
Their lawyers and the ACLU of Illinois filed the suit Friday and asked for an emergency hearing.
This week, Judge Thomas Durkin ordered the Cook County Clerk to issue a license, propelling the couple into the state's historic books.
"Vernita is terminally ill and she wishes to marry the woman she loves before she dies," said Camilla Taylor of Lambda Legal, which filed the lawsuit on their behalf. "And now she won't have to wait another day. These two women, who have loved and cared for each other in good times and bad, through sickness and through health, will get to know what it means to be married."
Gray was diagnosed with cancer in 1996, and has undergone years of treatment.
"Their love deserves the dignity of marriage now and there is simply no justification for forcing them to wait," said John Knight, LGBT project director at the ACLU of Illinois.
The two have been in a committed relationship for five years.
Their first date was a Shakespeare play.
CNN's Jennifer Feldman contributed to this report