Solar power being stochastic and asynchronous in nature, its integration with conventional power generation has so many challenges in damping of low-frequency oscillations. This study presents an investigation of low-frequency oscillation and damping of stochastic solar power integrated power system by a unified power flow controller (UPFC)-based dual optimal controller, which gains are optimised by a novel hybrid particle swarm optimisation and improved grey wolf optimiser. The dual controller simultaneously controls the modulation index of series and phase angle of shunt converters of UPFC, which cooperate with each other, optimising its efficacy and thereby implementing the advantages of both static synchronous series compensator and static synchronous compensator. A detailed Eigen value analysis has been performed with time domain simulations to study the damped oscillatory response of variable and random solar penetration with a power system along with the interaction of solar power with variable synchronous power generations. For a multi-machine system, a multi-input single output dual controller is proposed. A maximum sensor and time delay have been considered to design the controller providing a realistic approach. It is observed that random and heavy solar penetration has a more detrimental effect on system oscillations, which can be damped heavily with the proposed controller, in contrast to particle swarm optimisation, differential evolution, grey wolf optimiser, differential evolution particle swarm optimisation optimised lead-lag and dual controllers.