In recent years, with films such as “Deepwater Horizon” and “Lone Survivor,” actor/director Peter Berg has turned his attention to dramatizing real-life events. In “Patriots Day” (CBS Films), starring Mark Wahlberg (who also starred in both previously mentioned movies), Berg may have made the best, if somewhat uneven, film of his career.

Tommy (Wahlberg), a fictional composite character, is a Boston cop known for his short fuse. Still in the doghouse with his superiors for an earlier incident, Tommy’s last act of contrition is donning a uniform and a dayglo police vest to join his fellow brothers in blue at the finish line of the Boston Marathon. Tommy’s story is one of the squares of fabric that make up the human quilt of the film.

Traversing the Boston-area, we are introduced to some of the key players in the hours leading up to the start of the marathon. Student Patrick (Christopher O’Shea) and his nurse wife Jessica (Rachel Brosnahan) plan to watch the race. As does dad Steve (Dustin Tucker) and his young son Leo (Lucas Thor Kelley). Tommy and his wife Carol (Michelle Monaghan) have a playful and affectionate relationship. Tommy’s boss, police commissioner Ed (John Goodman), respects him but also knows he needs to be kept in check. Cambridge-based grad student Dun Meng (Jimmy O. Yang) keeps in touch with his parents in China via FaceTime. Dedicated MIT security guard Sean (Jake Picking) makes plans with grad student Li (Lana Condor) to attend a Zac Brown Band concert. Watertown police sergeant Pugliese (Oscar-winner J.K. Simmons) eats donuts and smokes too much.

Meanwhile, the Tsarnaev brothers, determined and destructive Tamerlan (Themo Melikidze) and stoner student Dzhokhar (Alex Wolff), are planning to carry out their devastating plot which involves depositing two backpacks containing explosive devices at heavily populated areas near the finish line. Their relationship is alternately brotherly and psychotic. The presence of Tamerlan’s devoted wife Katherine (Melissa Benoist) and young daughter add another dimension to the dynamic of the household.

Berg does an admirable job of setting the stage, via the use of his actors, regional location shots and, ultimately, actual footage from the day itself. When the bombs go off, the violence is visceral and raw. There is blood and carnage. Some of the scenes are not for those with weak constitutions.

Following the bombing, the film shifts gears to become a full-fledged crime drama. The FBI, led by Rick (Kevin Bacon), and Governor Patrick (Michael Beach) become involved in the process of the investigation and manhunt. The tension is palpable, regardless of whether or not you know the outcome of the story. As the Tsarnaevs continue their killing spree, they abduct Dun, carjacking his SUV, adding to the suspenseful action playing out on screen, leading to the heart-stopping finale.

As previously mentioned, “Patriots Day” doesn’t shy away from the violence. The shootout between the police and the brothers goes on too long. Goodman’s problematic Boston accent is distracting from the first time we see him onscreen to the last.

Regardless, the emotional coda, including interviews with Patrick Downes, Jessica Kensky, Steve Woolfenden and Deval Patrick, as well as a memorial to the deceased, only adds to the power of the film. "Patriots Day" is a touching homage to lives forever changed by the events of April 15, 2013, and for that, it gets a B+.