WASHINGTON — Commerce Secretary Wilbur Ross has shifted his explanation for adding a citizenship question to the 2020 census, saying he now recalls discussing it with Stephen K. Bannon, President Trump’s former chief strategist, according to court documents filed Thursday.

Mr. Ross, who faces a court order to provide a deposition to the plaintiffs in a lawsuit seeking to strip the question from the questionnaire, told a congressional committee earlier this year that he had only talked about the question with Justice Department officials to determine its legality.

Mr. Ross now says Mr. Bannon suggested that he contact Kris Kobach, the Kansas secretary of state whom Mr. Trump appointed to a commission to investigate his unsubstantiated claims that millions of illegal immigrants cast ballots for Hillary Clinton in 2016. The panel was later disbanded, and Mr. Kobach is currently the Republican candidate for governor of Kansas.

Mr. Bannon, whose first name is misspelled as “Steven” in government documents, “called Secretary Ross in the Spring of 2017 to ask Secretary Ross if he would be willing to speak” to Mr. Kobach, according to a document filed by Justice Department lawyers representing Mr. Ross.