BART says it has lined up $6.8 million in federal funds to keep a special police patrol on trains traveling through its busiest stations and upgrade its security systems.

The funding will maintain BART’s Critical Asset Patrol, seven officers and one sergeant, to provide a visible presence on trains, particularly at peak travel periods, and to collaborate with other law enforcement agencies, Bay Area Rapid Transit officials said Monday. The patrol was started in 2011 and is trained, among other things, to respond rapidly to threats of terrorism, said BART spokesman Jim Allison,

The funding will also pay for improved security cameras at three San Francisco stations — Powell Street, Civic Center and 16th Street — and for radio equipment that will make it easier for officers on underground trains to contact above-ground regional offices in San Francisco, Alameda and Contra Costa counties, BART said.

BART General Manager Grace Crunican credited Rep. Eric Swalwell, D- Dublin, with leading a successful effort to obtain the funding from the Federal Emergency Management Agency.

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter:@BobEgelko