We present a novel compact wideband waveguide T-junction power divider especially suited for mm-wave and THz frequencies. It incorporates substrate-based elements into a waveguide structure to provide the output port's isolation and matching. The internal port is introduced at the apex of the Tjunction formed as E-probe on a substrate. This facilitates efficient coupling of the reflected energy from the output port to a novel thin-film based resistive termination integrated with the E-probe onto the same substrate and fabricated by means of thinfilm technology. A power divider was designed, simulated, and fabricated for the frequency band 150-220 GHz, to experimentally verify the theoretical and simulated performance. The results showed excellent agreement between the simulations and measurements with the devices demonstrating a remarkable return loss of 20 dB for both the input and output ports for a three-port device with equal split and isolation better than 17 dB between the output ports. Furthermore, the measured insertion loss is less than 0.3 dB and the amplitude and phase imbalance are 0.15 dB and 0°, respectively. Moreover, the divider's remarkable tolerance to the dimensions and sheet resistance of the resistive material of the built-in absorbing load, makes the device a very practical component for mm-wave and THz systems, in particular radio-astronomy receivers.