In this study, the numerical solutions of the modified Fornberg–Whitham (mFW) equation, which describes immigration of the solitary wave and peakon waves with discontinuous first derivative at the peak, have been obtained by the collocation finite element method using quintic trigonometric B-spline bases. Although there are solutions of this equation by semi-analytical and analytical methods in the literature, there are very few studies on the solution of the equation by numerical methods. Any linearization technique has not been used while applying the method. The stability analysis of the applied method is examined by the von-Neumann Fourier series method. To show the performance of the method, we have considered three test problems with nonhomogeneous boundary conditions having analytical solutions. The error norms L
2 and L
∞ are calculated to demonstrate the accuracy and efficiency of the presented numerical scheme.