Correction: An earlier version of this story incorrectly said that Holder had testified before the House Oversight and Government Reform Committee in early April. His testimony took place during an oversight hearing of the House Judiciary Committee. This version has been corrected.

Attorney General Eric H. Holder Jr. speaks at the Justice Department's Diversity and Inclusion Speaker Series, Wednesday, April 23, 2014, at the Justice Department building. (Susan Walsh/AP)

Attorney General Eric H. Holder Jr. has decided to stay in his job through the fall midterm elections but he will not commit beyond the end of the year, according to Justice Department officials familiar with his plans.

After Health and Human Services Secretary Kathleen Sebelius announced her resignation earlier this month, some Washington insiders speculated that Holder would resign before the midterm elections, because it would be more difficult to confirm a new attorney general if the Democrats lost control of the Senate.

A medical scare in February added to the sense that Holder’s departure might be imminent. During a staff meeting, he felt faint and was taken by ambulance to a hospital where he was treated for an elevated heart rate. Holder told close friends that it was “spooky” and that he felt like it was a “sign” that he should spend more time with his family.

But Justice Department officials and others close to Holder, 63, said that several initiatives he has cared about deeply for a long time are underway, and that he is not in a hurry to leave.

One official close to Holder described the attorney general as being “in the twilight of his tenure” and feeling an urgency to put key initiatives in place.

“He is as energized and excited about the work he’s doing now [as] I’ve ever seen him in the 16 years I’ve known him,” said Robert Raben, a Washington lobbyist and an assistant attorney general in the Clinton administration who worked with Holder.

Holder has indicated that he does not want to remain attorney general through President Obama’s second term.

As the first African American attorney general, Holder has made civil rights, criminal justice reform, voting rights and gay rights the centerpieces of his tenure.

His efforts to reform the criminal justice system gathered steam in August when he announced that low-level, nonviolent drug offenders with no connection to gangs or large-scale drug organizations would not be charged with offenses that call for strict mandatory sentences. This week, he announced a major clemency initiative that is likely to encourage tens of thousands of nonviolent drug offenders in federal prison to seek reduced sentences.

Holder also wants to be at the helm of the Justice Department if the Supreme Court takes up the issue of same-sex marriage again, including the refusal of some states to recognize such unions.

Holder, who in February called lesbian, gay, bisexual and transgender rights “one of the civil rights challenges of our time,” has said he is proud that he overruled key Justice Department lawyers in 2011 and decided the department would no longer back the 1996 Defense of Marriage Act. That legislation defined marriage as a union between a man and a woman and denied marriage-based federal benefits to same-sex married couples.

This summer, Holder is planning to mark the 60th anniversary of the Brown v. Board of Education decision and the 50th anniversary of the signing of the Civil Rights Act.

Several large financial fraud cases also are expected to be announced in the coming months, department officials said.

Arguments about another issue high on Holder’s agenda, the constitutionality of the Texas voter ID law, are expected in federal court in September.

Holder is still a lightning rod for Republican lawmakers, especially in the House, and that was evident two weeks ago when he testified for 3 1/ 2 hours before the House Judiciary Committee, where he tangled with several members, including Rep. Louie Gohmert (R-Tex.), who brought up the House contempt vote against Holder two years ago over documents Congress wanted regarding a botched firearms operation known as Fast and Furious.

Another Texas Republican, Rep. Blake Farenthold, who has called for Holder’s resignation, said he didn’t want to even ask Holder questions because, he suggested, the attorney general should be in jail.

The hearing was so contentious that the next day, Holder brought it up when he spoke before the Rev. Al Sharpton’s National Action Network.

“The last five years have been defined by significant strides and by lasting reforms even in the face, even in the face of unprecedented, unwarranted, ugly and divisive adversity,” Holder said in his speech. “If you don’t believe that, you look at the way — forget about me, forget about me. You look at the way the attorney general of the United States was treated yesterday by a House committee — has nothing to do with me, forget that. What attorney general has ever had to deal with that kind of treatment?”

Holder’s aides say he wants to visit every one of the nation’s 93 U.S. attorney’s offices before he leaves. He’s traveling to three of them Thursday and Friday in Plano, Tex., Oklahoma City and Omaha. There are fewer than 10 to go.