The extraction of target analytes from biological samples is a bottleneck in analysis. A microfluidic device featuring an electrokinetic size and mobility trap was formed by two nanojunctions of different pore size to extract and concentrate analytical targets from complex samples. The trap was seamlessly coupled with electrophoretic separation for quantitative analysis. The device was applied to the analysis of ampicillin levels in blood within 5 min and a linear response over the range of 2.5–20 μg mL−1. This covers the recommended levels for treating sepsis, a critical condition with 30 to 50 % mortality and unpredicted drug levels. The device provides a new opportunity for on-site therapeutic drug monitoring, which should enable quick and accurate dosing and may save lives in such critical conditions.