Classical dynamic balancing techniques do not consider the linkage elastic behavior. For mechanism or robot design purpose, taking into account the flexibility of the multibody system is of utmost importance, in order to be able to manufacture a mechanism/robot which is stiff enough for a given task. This paper deals with a novel approach that allows to design mechanisms by means of structural topology optimization while specific dynamic balancing conditions are considered. In our work, the links are treated as three-dimensional flexible bodies, and the optimization process is performed for all the bodies simultaneously. Applying this methodology, the optimal design of a dynamically balanced four-bar linkage is accomplished while its compliance is minimized. Numerical validations of the optimized linkage properties are carried out using commercial software. The dynamic balancing performance of the optimized four-bar linkage is numerically validated using adams. Besides, ansys software was used in order to perform the linkage stiffness analysis and to compare it with the results of the optimization solver. In order to verify the feasibility of the proposed methodology, a prototype is built. Experimental studies are carried out in order to evaluate its dynamic balancing performance.