At left, Rep. Joe Kennedy of Massachusetts who is challenging incumbent Sen. Ed Markey, at right, in the Democratic primary for his US Senate seat.
CNN  — 

Incumbent Sen. Ed Markey and Rep. Joe Kennedy posted nearly identical second quarter fundraising totals in the competitive Massachusetts Senate Democratic primary, signs of a close race with a month and a half to go before votes are cast.

Markey, who first came to the Senate after winning a special election in 2013 and then was reelected in 2014, reported raising $1.96 million between the start of April and the end of June, and finished the quarter with about $4.8 million in cash on hand. Kennedy reported raising $1.91 million and also ended the quarter with about $4.8 million in cash on hand.

Even excluding other sources of funds like transfers, offsets and loans, the candidates were neck-and-neck, with Markey reporting $1.84 million and Kennedy reporting $1.88 million in net contributions.

Kennedy held a significant spending edge in the quarter, however, reporting nearly $3.4 million in total expenditures to Markey’s $1.6 million. That disparity has played out on the airwaves, where Kennedy outspent Markey about $1.8 million to just $52,000 on advertising between the beginning of April and the end of June, according to data from CMAG.

Kennedy had outraised Markey in the last two quarters and entered the second quarter with more than $6.2 million cash on hand to Markey’s $4.4 million, but Kennedy’s heavy spending in the period left the candidates with roughly equal cash stockpiles for the primary’s home stretch.

The primary between Markey and Kennedy has reflected some of the ideological and generational divides in Democratic politics, as Markey has received endorsements from high-profile members of the progressive wing of the party and Kennedy has support from a number of moderate and establishment figures, though Markey is also supported by Minority Leader Chuck Schumer and has the backing of the party’s Senate campaign committee.

Rep. Alexandria Ocasio-Cortez, who worked with Markey as leading sponsors of the Green New Deal, has endorsed Markey, along with Sen. Elizabeth Warren and Rep. Ro Khanna. Kennedy, meanwhile, has been endorsed by Civil Rights icon Rep. John Lewis, Rep. Joaquin Castro, and a number of his former House colleagues; he was also endorsed by Rep. Mark Pocan, co-chair of the Congressional Progressive Caucus.

The Massachusetts Democratic Senate primary is set to take place on September 1.

Markey’s campaign manager John Walsh said in a statement, “The second quarter of fundraising was our strongest yet.”

“These fundraising totals are indicative of the momentum of this campaign, which is witnessing a surge of enthusiasm,” Walsh said. “Our supporters are organized, they are activated, and they know that we need to send Ed Markey back to the United States Senate.”

Emily Kaufman, spokeswoman for the Kennedy campaign, said in a statement, “Joe is incredibly proud of the support he is receiving from voters across the state who are ready for change – and for a Senator who shows up for Massachusetts.”

UPDATE: This story has been updated to include that Markey has the support of Senate Minority Leader Chuck Schumer and the Democratic Senatorial Campaign Committee, as well as statements from both campaigns.