Near-infrared fluorescent proteins (NIR FPs) engineered from bacterial phytochromes are widely used for structural and functional deep-tissue imaging in vivo. To fluoresce, NIR FPs covalently bind a chromophore, such as biliverdin IXa tetrapyrrole. The efficiency of biliverdin binding directly affects the fluorescence properties, rendering understanding of its molecular mechanism of major importance. miRFP proteins constitute a family of bright monomeric NIR FPs that comprise a Per-ARNT-Sim (PAS) and cGMP-specific phosphodiesterases - Adenylyl cyclases - FhlA (GAF) domain. Here, we structurally analyze biliverdin binding to miRFPs in real time using time-resolved stimulated Raman spectroscopy and quantum mechanics/molecular mechanics (QM/MM) calculations. Biliverdin undergoes isomerization, localization to its binding pocket, and pyrrolenine nitrogen protonation in <1 min, followed by hydrogen bond rearrangement in ~2 min. The covalent attachment to a cysteine in the GAF domain was detected in 4.3 min and 19 min in miRFP670 and its C20A mutant, respectively. In miRFP670, a second C–S covalent bond formation to a cysteine in the PAS domain occurred in 14 min, providing a rigid tetrapyrrole structure with high brightness. Our findings provide insights for the rational design of NIR FPs and a novel method to assess cofactor binding to light-sensitive proteins.