Taylor Swift revealed that a song that will debut with the release of her upcoming Netflix documentary, “Miss Americana,” was recorded in response to the 2018 midterm elections.

The singer’s new track, “Only the Young,” will play over the end credits of the documentary, which drops on Jan. 31. The 30-year-old artist recorded the song as part of her “Lover” album but kept it under wraps in the hope of releasing it at a time when its political message might resonate with and inspire her audience a bit more.

Speaking to Variety, Swift explained that the song’s origins stemmed from her personal disappointment following the 2018 elections that saw Republicans maintain control of the Senate.

“I wrote it after the midterm elections, when there were so many young people who rallied for their candidate, whether it was a senator or congressman or congresswoman,” Swift told the outlet. “It was hard to see so many people feel like they had canvassed and done everything and tried so hard. I saw a lot of young people’s hopes dashed. And I found that to be particularly tragic, because young people are the people who feel the worst effects of gun violence, and student loans and trying to figure out how to start their lives and how to pay their bills, and climate change, and are we going to war — all these horrific situations that we find ourselves facing right now.”

TAYLOR SWIFT ON NOT WANTING TO GET POLITICAL FOLLOWING DIXIE CHICKS CONTROVERSY: 'IT TERRIFIED ME'

Specifically, Swift explained that she was affected by the race in Tennessee, where she supported Democratic candidate Phil Bredesen only for his opponent, Republican Marsha Blackburn, to win the Senate race.

Taylor Swift explained that her new track is politically charged.

Taylor Swift explained that her new track is politically charged. (Jordan Strauss/Invision/AP)

“I was really upset about Tennessee going the way that it did, obviously. And so I just wanted to write a song about it. I didn’t know where it would end up,” Swift explained. “But I did think that it would be better for it to come out at a time that it could maybe hopefully stoke some fires politically and maybe engage younger people to form their own views, break away from the pack, and not feel like they need to vote exactly the same way that people in their town are voting.”

Lyrics from the song include: “You did all that you could do / The game was rigged, the ref got tricked/ The wrong ones think they’re right / We were outnumbered — this time.”

Elsewhere in the cover story with Variety, Swift explained that she made the decision to end her long pattern of staying out of the political fray with moves like endorsing Bredesen and her pro-LGBTQ track “You Need to Calm Down” after taking specific issue with “sinister” Republican policies.

TAYLOR SWIFT REVEALS HER MOTHER ANDREA, 62, WAS DIAGNOSED WITH BRAIN TUMOR

“To celebrate but not advocate felt wrong for me,” she said of her LGBTQ fan base. “Using my voice to try to advocate was the only choice to make. Because I’ve talked about equality and sung about it in songs like ‘Welcome to New York,’ but we are at a point where human rights are being violated. When you’re saying that certain people can be kicked out of a restaurant because of who they love or how they identify, and these are actual policies that certain politicians vocally stand behind, and they disguise them as family values, that is sinister. So, so dark.”

Taylor Swift explained that she wrote a new song in response to the 2018 midterm elections, where the candidate she endorsed lost. 

Taylor Swift explained that she wrote a new song in response to the 2018 midterm elections, where the candidate she endorsed lost.  (Chris Pizzello/Invision/AP, File)

Prior to voting day in 2018, Swift posted a lengthy note on Instagram, directly breaking her political silence for the first time in order to criticize Blackburn.

“As much as I have in the past and would like to continue voting for women in office, I cannot support Marsha Blackburn," Swift told her 112 million Instagram followers. "Her voting record in Congress appalls and terrifies me."

Swift said the congresswoman "voted against equal pay for women. She voted against the Reauthorization of the Violence Against Women Act, which attempts to protect women from domestic violence, stalking, and date rape. She believes businesses have a right to refuse service to gay couples. She also believes they should not have the right to marry.

CLICK HERE TO GET THE FOX NEWS APP

"These are not MY Tennessee values," the "Fearless" singer said at the time.